trw.reporting.reporting_bokeh

Module Contents

Classes

Object

Functions

create_default_reporting_options(embedded=True, config={})

config must follow this scheme:

create_tables(name, role, doc, options, connection)

Create a UI from a SQL table and return a Panel

report(sql_database_path, options, doc=None)

Generate the reporting from a SQL database and configuration.

run_server(path_to_db, options=create_default_reporting_options(embedded=True), show_app=True, handlers=[], port=5100)

Run a server

Attributes

config

class trw.reporting.reporting_bokeh.Object
trw.reporting.reporting_bokeh.create_default_reporting_options(embedded=True, config={})

config must follow this scheme: {

table_name: {

option1: value1

}

}

The different options will depend on the table role.

  • for ALL tables:

    {n

    ‘data’{

    ‘remove_columns’: [‘column_name1’], ‘subsampling_factor’: 1.0, ‘keep_last_n_rows’: 1000

    }

  • For role data_samples:
    {
    ‘default’:

    ‘Scatter X Axis’: value, ‘Scatter Y Axis’: value, ‘Color by’: value, ‘Color scheme’: value, ‘Binning X Axis’: value, ‘Binning Y Axis’: value, ‘Label with’: value, ‘Display with’: value,

    }

trw.reporting.reporting_bokeh.create_tables(name, role, doc, options, connection)

Create a UI from a SQL table and return a Panel

trw.reporting.reporting_bokeh.report(sql_database_path, options, doc=None)

Generate the reporting from a SQL database and configuration.

Parameters
  • sql_database_path – the path to the SQLite database

  • options – the options to configure the different reporting views

  • doc – a possibly existing Bokeh document

Returns

a populated Bokeh document

trw.reporting.reporting_bokeh.run_server(path_to_db, options=create_default_reporting_options(embedded=True), show_app=True, handlers=[], port=5100)

Run a server

Note

the .db will be replaced by .json if a file with this name is present, it will be imported and used as configuration

Parameters
  • path_to_db – the path to the SQLite database

  • options – configuration options

  • show_app – if True, the application will be started in an open browser

  • handlers – additional handlers for the Bokeh application

  • port – the port of the server

trw.reporting.reporting_bokeh.config