Lumen provides a framework for visual analytics, which allows users to build data-driven dashboards from a simple yaml specification

Overview

Lumen

Illuminate your data

Build Status Linux/MacOS/Windows Build Status
Coverage codecov
Latest dev release Github tag dev-site
Latest release Github release PyPI version lumen version conda-forge version defaults version
Docs gh-pages site
Support Discourse

Why Lumen?

The Lumen project provides a framework for visual analytics, which allows users to build data-driven dashboards from a simple yaml specification. The power of Lumen comes from the ability to leverage the powerful data intake, data processing and data visualization libraries available in the PyData ecosystem.

  • Data Intake: A flexible system for declaring data sources with strong integration with Intake, allows Lumen to query data from a wide range of sources including many file formats such as CSV or Parquet but also SQL and many others.
  • Data Proccessing: Internally Lumen stores data as DataFrame objects, allowing users to leverage familiar APIs for filtering and transforming data using Pandas while also providing the ability to scale these transformations out to a cluster thanks to Dask.
  • Data Visualization: Since Lumen is built on Panel all the most popular plotting libraries and many other components such as powerful datagrids and BI indicators are supported.

The core strengths of Lumen include:

  • Flexibility: The design of Lumen allows flexibly combining data intake, data processing and data visualization into a simple declarative pipeline.
  • Extensibility: Every part of Lumen is designed to be extended letting you define custom Source, Filter, Transform and View components.
  • Scalability: Lumen is designed with performance in mind and supports scalable Dask DataFrames out of the box, letting you scale to datasets larger than memory or even scale out to a cluster.
  • Security: Lumen ships with a wide range of OAuth providers out of the box, making it a breeze to add authentication to your applications.

Examples

London Bike Points
NYC Taxi
Palmer Penguins
Precipitation
Seattle Weather

Getting started

Lumen works with Python 3 and above on Linux, Windows, or Mac. The recommended way to install Lumen is using the conda command provided by Anaconda or Miniconda:

conda install -c pyviz lumen

or using PyPI:

pip install lumen

Once installed you will be able to start a Lumen server by running:

lumen serve dashboard.yaml --show

This will open a browser serving the application or dashboard declared by your yaml file in a browser window. During development it is very helpful to use the --autoreload flag, which will automatically refresh and update the application in your browser window, whenever you make an edit to the dashboard yaml specification. In this way you can quickly iterate on your dashboard.

Try it out! Click on one of the examples below, copy the yaml specification and launch your first Lumen application.

Comments
  • Renaming Target

    Renaming Target

    With the Lumen 0.5.0 release finally coming up we've got one last chance to fix naming mistakes in Lumen. One major sticking point has always been the Target component. This name came about as a natural pair to the data Source, where data would flow from source to target. However, even then it never really made sense and since there's been quite a lot of refactoring that more cleanly separates views, filters and transforms (which used to be grouped together on a target).

    This means that now a Target is defined as a component consisting of one or more view components that consume data from a pipeline and render the views into a layout. Therefore I suggest I finally pull the trigger and simply rename Target -> Layout. Alternatively I could also consider LayoutGroup as the name of the Python class but keep the YAML key as layouts.

    I'd like to collect everyone's opinion so please chime in @Hoxbro, @maximlt, @jbednar, @droumis, @jlstevens and @eli-pinkus.

    opened by philippjfr 9
  • Allow launching UI from CLI

    Allow launching UI from CLI

    Adds a lumen builder CLI command that launches a Bokeh/Panel server running the builder.

    • [x] Add tests
    • [x] Decide on naming of builder, is it ui, gui, or builder?
    opened by philippjfr 8
  • Create how to on custom local components

    Create how to on custom local components

    • [x] import a component by its module path, e.g. you can do my_library.some_module.MyTransform

    • Also made the install page more explicit about python installation after a good talk with @Hoxbro.

    • Also included some minor fixes like syntax highlighting and a couple of links

    127 0 0 1_5500_docs__build_html_how_to_local_components html (1)

    opened by droumis 5
  • Example for how to use variables

    Example for how to use variables

    It started with an example of how to use variables but failed with a verification error. This is fixed with 488ee9c5d935788602d1de50f4f8f93032040ee5.

    Though, I still get this warning WARNING:param.Source: Resolving nested variable references currently not supported. which I think is why I get no automatic update when changing the variable input.

    Maybe I'm doing something wrong with the specification.

    variables:
      ticker:
        type: widget
        kind: TextInput
        default: https://raw.githubusercontent.com/matplotlib/sample_data/master/aapl.csv
    
    sources:
      stock_data:
        type: file
        tables:
          ticker: $variables.ticker
    
    targets:
    - title: Table
      source: stock_data
      views:
        - type: table
          table: ticker
    
    opened by Hoxbro 5
  • Added suggestion for mistyped/wrong parameters

    Added suggestion for mistyped/wrong parameters

    It can be hard to know if something is transform or transforms. I have tried to take account of this by using difflib to come up with suggestions if parameters are mistyped/wrong.

    I have chosen to raise an error when an input parameter does not match the class parameters. My reasoning for this is that the error usually will arrive later, making it harder to debug.

    I have used the following example to see if I can provoke an error by adding or removing an s.

    from lumen.pipeline import Pipeline
    
    data_url = 'https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-07-28/penguins.csv'
    
    pipeline = Pipeline.from_spec({
        'source': {
            'type': 'file',
            'table': {
                'penguins': data_url
            }
        },
        'filters': [
            {'type': 'widget', 'field': 'species'},
            {'type': 'widget', 'field': 'island'},
            {'type': 'widget', 'field': 'sex'},
            {'type': 'widget', 'field': 'year'}
        ],
        'transforms': [
            {'type': 'aggregate', 'method': 'mean', 'by': ['species', 'sex', 'year']}
        ]
    })
    

    The example will raise an error (try to find out what raises it).

    Error message

    Before:

    image

    After:

    image

    opened by Hoxbro 5
  • ModuleNotFoundError: No module named 'panel.pane.perspective' when running lumen

    ModuleNotFoundError: No module named 'panel.pane.perspective' when running lumen

    I'm having trouble with an error message "ModuleNotFoundError: No module named 'panel.pane.perspective' " when attempting to launch lumen https://lumen.holoviz.org/index.html. error panel

    I have panel 0.11.0a8 installed through conda with pyviz/label/dev. Any insights please?

    opened by eschares 5
  • Add ability to generate specification

    Add ability to generate specification

    All components currently implement .from_spec methods which instantiate the component from the declarative specification. We want to be able to do the reverse and construct a specification from component instances by implementing .to_spec methods.

    For all the basic component types this should be fairly straightforward, e.g. a Source, View or Filter simply has to serialize it's parameters and its type. It becomes a little more difficult if we are dealing with references and variables because View.pipeline should generally not inline and serialize the entire Pipeline specification.

    def to_spec(self, allow_refs=True):
        """
        Converts the component to a declarative specification that can be serialized to YAML.
        Whether sub-component definitions are inlined depends on the type of component,
        e.g. Filter and Transform components will be inlined on a Pipeline but a Pipeline will
        not be inlined on a View.
    
        Arguments
        -----------
        allow_refs: boolean
          Whether to allow exporting references or to inline the materialized values.
    
        Returns
        --------
        Declarative specification containing the definition of this component.
        """
    

    Goals

    • We can serialize all component types individually but also a whole Dashboard or Pipeline definition.
    • We can handle references and variables
    • The exported specification faithfully roundtrips to an identical instance, i.e. we can go from instance -> specification -> instance and end up with an identical copy.
    opened by philippjfr 4
  • Various improvements to the DateFilter widget

    Various improvements to the DateFilter widget

    Includes various fixes to the DateFilter:

    • On picker mode cast start/end/value to datetime.date
    • Override the value Parameter by a CalendarDate or DateRange Parameters (let me know if there's a better way, that looks hacky!)
    • Bidirectionally link the widget to the value Parameter, this allows URL query parameter changes to be synced back to the widget.

    This is work in progress and requires other changes both in Param and Panel. I've also noticed accumulating calls in get_data on picker mode so there's something wrong there.

    opened by maximlt 4
  • Display selected custom view parameters as widgets

    Display selected custom view parameters as widgets

    This issue summarizes some discussion I've had with @philippjfr and @jbednar about how best to generate widgets for custom view parameters. Here are the three options we talked about:

    1. Use param precedence according to the usual panel semantics when converting parameters to widgets.
    2. Declaring constant=True for the parameters that shouldn't be shown as widgets.
    3. Explicitly list which parameters should become widgets (by name) in the yaml declaration.

    Personally, I like option 3 the most as it is the most explicit and lets you easily set the widget order in the yaml. Then I like option 1 as it is consistent with how panel displays widgets for parameters and I like option 3 the least.

    opened by jlstevens 4
  • Gracefully Handle Multiple Extensions or Assert an Error Message

    Gracefully Handle Multiple Extensions or Assert an Error Message

    If different views are used (for example Perspective with Holoviews), the dashboard doesn’t build, as two separate extensions are needed.

    It would be nice if the various extensions could be gracefully handled, if not an assertion error on crossing multiple extensions would be nice for users to understand the error instead of the dashboard not displaying anything.

    opened by tlmille2 4
  • Add functionality to manually apply updates

    Add functionality to manually apply updates

    Adds a manual_update option to the global config, each Target and Pipeline to be able to manually update the data using a button click. This is useful when applying a filter or transform is very slow.

    apply_update

    • [x] Add tests
    • [x] Decide on naming of manual_update parameter
    opened by philippjfr 3
  • Make

    Make "non-standard" keywords in methods keyword-only arguments

    Some methods in Lumen need different inputs depending on the class it is called from. An example of this could be from_spec, the example below. I would like to see these non-standard keywords being keyword-only arguments, so passing in the wrong arguments is impossible.

    https://github.com/holoviz/lumen/blob/95809959b18eb31d069c084f4fabdefbc2cfb05e/lumen/views/base.py#L267-L269

    https://github.com/holoviz/lumen/blob/95809959b18eb31d069c084f4fabdefbc2cfb05e/lumen/dashboard.py#L299

    opened by Hoxbro 0
  • Host CSV dataset ourself

    Host CSV dataset ourself

    Currently, the penguins' dataset (https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-07-28/penguins.csv) is used extensively in the new documentation.

    It should be added to this repo or an S3 (which we control).

    opened by Hoxbro 2
  • Added threadpool to WebsiteSource

    Added threadpool to WebsiteSource

    I just thought it made a lot of sense to check the websites asynchronously.

    I have set a 10 seconds timeout, which could be removed again or given as a parameter.

    opened by Hoxbro 1
  • Make it possible to programmatically unselect/reset widget filter in a Notebook Pipeline

    Make it possible to programmatically unselect/reset widget filter in a Notebook Pipeline

    Once a widget filter has been selected in a Lumen Pipeline within a notebook, there is no way to programmatically unselect or reset the filter.

    ALL software version info

    lumen: 0.5.0a64

    Description of expected behavior and the observed behavior

    A way to programmatically unselect options in a widget filter. @Hoxbro suggested: pipeline.reset_filters()

    Complete, minimal, self-contained example code that reproduces the issue

    import lumen
    from lumen.views import Table
    from lumen.pipeline import Pipeline
    import panel as pn
    
    pn.extension('tabulator', template='fast')
    
    data_url = 'https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-07-28/penguins.csv'
    
    pipeline = Pipeline.from_spec({
        'source': {
            'type': 'file',
            'tables': {
                'penguins': data_url
            }
        },
        'filters': [
            {'type': 'widget', 'field': 'species'},
            {'type': 'widget', 'field': 'island'},
            {'type': 'widget', 'field': 'sex'},
            {'type': 'widget', 'field': 'year'}
        ],
        'transforms': [
            {'type': 'aggregate', 'method': 'mean', 'by': ['sex', 'year']}
        ]
    })
    
    pn.Row(pipeline.control_panel, Table(pipeline=pipeline, pagination='remote'))
    

    Screenshots or screencasts of the bug in action

    Screenshot 2022-09-21 at 17 33 02 enhancement 
    opened by droumis 4
  • Add more Sources tests

    Add more Sources tests

    Changes addressed in this PR:

    • split catalog to different files to test IntakeSource and IntakeSQLSource separately
    • move tests for FileSource to a new file
    • add tests to JSONSource
    • add tests to JoinedSource
    • move common testing logics to a utils file
    • test Source.from_spec when loading from source in state.sources

    Bug fixes:

    • JSONSource._resolve_template_vars(): convert template to string to make sure re.findall(template) work properly. Currently, a local file path will be read as a pathlib.PosixPath object: https://github.com/holoviz/lumen/blob/master/lumen/sources/base.py#L528
    opened by thuydotm 1
Releases(v0.5.0)
  • v0.4.1(Apr 23, 2021)

  • v0.4.0(Apr 23, 2021)

    (Relatively) major release:

    New features:

    • Handle errors while rendering dashboard (#131)
    • Defer rendering of dashboard contents until page is rendered (#123)
    • Add Melt transform (#122)
    • Implement DerivedSource with ability to filter and transform existing sources (#121)
    • Add caching to DerivedSource
    • Use Datetime pickers (#119)

    Bugfixes and minor improvements:

    • Clear original source cache on DerivedSource
    • Allow providing custom Download labels (#130)
    • Fix handling of range filters (#129)
    • Unpack panes correctly on Views (#128)
    • Fixed dask kwarg on JSONSource (#127)
    • Pin python3.8 in conda build env
    • Ensure None on widget filter is handled (#120)
    • Improve docs (#112)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.2(Apr 23, 2021)

  • v0.3.1(Apr 23, 2021)

    Minor release:

    • Updated dependencies
    • Add Download options to targets (#110)
    • Make editable a configurable option (#109)
    • Improve docs (#107, #108)
    • Gracefully handle missing dask and parquet libraries (#105)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Mar 17, 2021)

  • v0.1.0(Oct 15, 2020)

    This is the first public release of the Lumen project, which provides a framework to build dashboards from a simple yaml specification. It is designed to query information from any source, filter it in various ways and then provide views of that information, which can be anything from a simply indicator to a table or plot.

    For now the Lumen project is available only from conda and can be installed with conda install -c pyviz/label/dev lumen.

    Source code(tar.gz)
    Source code(zip)
Owner
HoloViz
High-level tools to simplify visualization in Python
HoloViz
Getting started with Python, Dash and Plot.ly for the Data Dashboards team

data_dashboards Getting started with Python, Dash and Plot.ly for the Data Dashboards team Getting started MacOS users: # Install the pyenv version ma

Department for Levelling Up, Housing and Communities 1 Nov 8, 2021
Active Transport Analytics Model (ATAM) is a new strategic transport modelling and data visualization framework for Active Transport as well as emerging micro-mobility modes

{ATAM} Active Transport Analytics Model Active Transport Analytics Model (“ATAM”) is a new strategic transport modelling and data visualization framew

Peter Stephan 0 Jan 12, 2022
Python ts2vg package provides high-performance algorithm implementations to build visibility graphs from time series data.

ts2vg: Time series to visibility graphs The Python ts2vg package provides high-performance algorithm implementations to build visibility graphs from t

Carlos Bergillos 26 Dec 17, 2022
The windML framework provides an easy-to-use access to wind data sources within the Python world, building upon numpy, scipy, sklearn, and matplotlib. Renewable Wind Energy, Forecasting, Prediction

windml Build status : The importance of wind in smart grids with a large number of renewable energy resources is increasing. With the growing infrastr

Computational Intelligence Group 125 Dec 24, 2022
Data-FX is an addon for Blender (2.9) that allows for the visualization of data with different charts

Data-FX Data-FX is an addon for Blender (2.9) that allows for the visualization of data with different charts Currently, there are only 2 chart option

Landon Ferguson 20 Nov 21, 2022
LabGraph is a a Python-first framework used to build sophisticated research systems with real-time streaming, graph API, and parallelism.

LabGraph is a a Python-first framework used to build sophisticated research systems with real-time streaming, graph API, and parallelism.

MLH Fellowship 7 Oct 5, 2022
PyFlow is a general purpose visual scripting framework for python

PyFlow is a general purpose visual scripting framework for python. State Base structure of program implemented, such things as packages disco

null 1.8k Jan 7, 2023
The visual framework is designed on the idea of module and implemented by mixin method

Visual Framework The visual framework is designed on the idea of module and implemented by mixin method. Its biggest feature is the mixins module whic

LEFTeyes 9 Sep 19, 2022
Time series visualizer is a flexible extension that provides filling world map by country from real data.

Time-series-visualizer Time series visualizer is a flexible extension that provides filling world map by country from csv or json file. You can know d

Long Ng 3 Jul 9, 2021
A Python package that provides evaluation and visualization tools for the DexYCB dataset

DexYCB Toolkit DexYCB Toolkit is a Python package that provides evaluation and visualization tools for the DexYCB dataset. The dataset and results wer

NVIDIA Research Projects 107 Dec 26, 2022
This component provides a wrapper to display SHAP plots in Streamlit.

streamlit-shap This component provides a wrapper to display SHAP plots in Streamlit.

Snehan Kekre 30 Dec 10, 2022
A python package for animating plots build on matplotlib.

animatplot A python package for making interactive as well as animated plots with matplotlib. Requires Python >= 3.5 Matplotlib >= 2.2 (because slider

Tyler Makaro 394 Dec 18, 2022
A python package for animating plots build on matplotlib.

animatplot A python package for making interactive as well as animated plots with matplotlib. Requires Python >= 3.5 Matplotlib >= 2.2 (because slider

Tyler Makaro 356 Feb 16, 2021
I'm doing Genuary, an aritifiacilly generated month to build code that make beautiful things

Genuary 2022 I'm doing Genuary, an aritifiacilly generated month to build code that make beautiful things. Every day there is a new prompt for making

Joaquín Feltes 1 Jan 10, 2022
An application that allows you to design and test your own stock trading algorithms in an attempt to beat the market.

StockBot is a Python application for designing and testing your own daily stock trading algorithms. Installation Use the

Ryan Cullen 280 Dec 19, 2022
🐍PyNode Next allows you to easily create beautiful graph visualisations and animations

PyNode Next A complete rewrite of PyNode for the modern era. Up to five times faster than the original PyNode. PyNode Next allows you to easily create

ehne 3 Feb 12, 2022
Visual Python is a GUI-based Python code generator, developed on the Jupyter Notebook environment as an extension.

Visual Python is a GUI-based Python code generator, developed on the Jupyter Notebook environment as an extension.

Visual Python 564 Jan 3, 2023
Make visual music sheets for thatskygame (graphical representations of the Sky keyboard)

sky-python-music-sheet-maker This program lets you make visual music sheets for Sky: Children of the Light. It will ask you a few questions, and does

null 21 Aug 26, 2022
A small script written in Python3 that generates a visual representation of the Mandelbrot set.

Mandelbrot Set Generator A small script written in Python3 that generates a visual representation of the Mandelbrot set. Abstract The colors in the ou

null 1 Dec 28, 2021