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
Visualise top-rated GitHub repositories in a barchart by keyword

This python script was written for simple purpose -- to visualise top-rated GitHub repositories in a barchart by keyword. Script generates html-page with barchart and information about repository own

Cur1iosity 2 Feb 07, 2022
A research of IT labor market based especially on hh.ru. Salaries, rate of technologies and etc.

hh_ru_research Проект реализован в учебных целях анализа рынка труда, в особенности по hh.ru Input data В качестве входных данных используются сериали

3 Sep 07, 2022
Python script for writing text on github contribution chart.

Github Contribution Drawer Python script for writing text on github contribution chart. Requirements Python 3.X Getting Started Create repository Put

Steven 0 May 27, 2022
The Timescale NFT Starter Kit is a step-by-step guide to get up and running with collecting, storing, analyzing and visualizing NFT data from OpenSea, using PostgreSQL and TimescaleDB.

Timescale NFT Starter Kit The Timescale NFT Starter Kit is a step-by-step guide to get up and running with collecting, storing, analyzing and visualiz

Timescale 102 Dec 24, 2022
This Crash Course will cover all you need to know to start using Plotly in your projects.

Plotly Crash Course This course was designed to help you get started using Plotly. If you ever felt like your data visualization skills could use an u

Fábio Neves 2 Aug 21, 2022
A Python function that makes flower plots.

Flower plot A Python 3.9+ function that makes flower plots. Installation This package requires at least Python 3.9. pip install

Thomas Roder 4 Jun 12, 2022
A simple python script using Numpy and Matplotlib library to plot a Mohr's Circle when given a two-dimensional state of stress.

Mohr's Circle Calculator This is a really small personal project done for Department of Civil Engineering, Delhi Technological University (formerly, D

Agyeya Mishra 0 Jul 17, 2021
Function Plotter: a simple application with GUI to plot mathematical functions

Function-Plotter Function Plotter is a simple application with GUI to plot mathe

Mohamed Nabawe 4 Jan 03, 2022
Log visualizer for whirl-framework

Lumberjack Log visualizer for whirl-framework Установка pip install -r requirements.txt Как пользоваться python3 lumberjack.py -l путь до лога -o

Vladimir Malinovskii 2 Dec 19, 2022
Numerical methods for ordinary differential equations: Euler, Improved Euler, Runge-Kutta.

Numerical methods Numerical methods for ordinary differential equations are methods used to find numerical approximations to the solutions of ordinary

Aleksey Korshuk 5 Apr 29, 2022
Sprint planner considering JIRA issues and google calendar meetings schedule.

Sprint planner Sprint planner is a Python script for planning your Jira tasks based on your calendar availability. Installation Use the package manage

Apptension 2 Dec 05, 2021
2D maze path solver visualizer implemented with python

2D maze path solver visualizer implemented with python

SS 14 Dec 21, 2022
High performance, editable, stylable datagrids in jupyter and jupyterlab

An ipywidgets wrapper of regular-table for Jupyter. Examples Two Billion Rows Notebook Click Events Notebook Edit Events Notebook Styling Notebook Pan

J.P. Morgan Chase 75 Dec 15, 2022
Browse Dash docsets inside emacs

Helm Dash What's it This package uses Dash docsets inside emacs to browse documentation. Here's an article explaining the basic usage of it. It doesn'

504 Dec 15, 2022
A Jupyter - Three.js bridge

pythreejs A Python / ThreeJS bridge utilizing the Jupyter widget infrastructure. Getting Started Installation Using pip: pip install pythreejs And the

Jupyter Widgets 844 Dec 27, 2022
Cryptocurrency Centralized Exchange Visualization

This is a simple one that uses Grafina to visualize cryptocurrency from the Bitkub exchange. This service will make a request to the Bitkub API from your wallet and save the response to Postgresql. G

Popboon Mahachanawong 1 Nov 24, 2021
Material for dataviz course at university of Bordeaux

Material for dataviz course at university of Bordeaux

Nicolas P. Rougier 50 Jul 17, 2022
HM02: Visualizing Interesting Datasets

HM02: Visualizing Interesting Datasets This is a homework assignment for CSCI 40 class at Claremont McKenna College. Go to the project page to learn m

Qiaoling Chen 11 Oct 26, 2021
Scientific measurement library for instruments, experiments, and live-plotting

PyMeasure scientific package PyMeasure makes scientific measurements easy to set up and run. The package contains a repository of instrument classes a

PyMeasure 445 Jan 04, 2023
A toolkit to generate MR sequence diagrams

mrsd: a toolkit to generate MR sequence diagrams mrsd is a Python toolkit to generate MR sequence diagrams, as shown below for the basic FLASH sequenc

Julien Lamy 3 Dec 25, 2021