InteractiveDashboard

class olliepy.InteractiveDashboard.InteractiveDashboard(**kwargs)[source]

InteractiveDashboard creates an interactive dashboard that can be used for EDA or error analysis.

titlestr

the title of the report

output_directorystr

the directory where the dashboard folder will be created

dataframesList[pd.DataFrame]

a list dataframes to be used in the dashboard

dataframes_namesList[str]

a list of the dataframes names

numerical_columnsList[str] default=None

a list of the numerical columns to be included in the dashboard

categorical_columnsList[str] default=None

a list of the categorical columns to be included in the dashboard

date_columnsList[str] default=None

a list of the date columns to be included in the dashboard

dashboard_folder_namestr default=None

the name of the folder that will contain all the generated report files. If not set, the title of the report will be used.

encryption_secretstr default=None

the 16 characters secret that will be used to encrypt the generated report data. If it is not set, the generated data won’t be encrypted.

generate_encryption_secretbool default=False

the encryption_secret will be generated and its value returned as output. you can also view encryption_secret to get the generated secret.

create_dashboard()

creates the dashboard

serve_dashboard_from_local_server()

serves the dashboard using a flask server

save_dashboard()

saves the dashboard to be used without a flask server.

bin_numerical_feature(numerical_feature_name: str, new_feature_name: str, number_of_bins: int, suffix: str = None) → None[source]

This will be a selected numerical feature. OlliePy will get the bins from the first data frame and apply these bins on the rest of the dataframes.

Parameters
  • numerical_feature_name – the numerical feature to bin

  • new_feature_name – the name of the new binned feature

  • number_of_bins – the number of bins to apply

  • suffix – suffix to add the bins value

Returns

None

create_dashboard(auto_generate_distribution_plots: bool = False) → None[source]

Creates a dashboard using the user defined data.

Parameters

auto_generate_distribution_plots – generate distribution plots and add them to the dashboard. default: False

get_charts() → List[dict][source]

Get a copy of the dashboard’s charts

Returns

List[dict] the charts

get_number_displays() → List[dict][source]

Get a copy of the dashboard’s number displays

Returns

List[dict] the number displays

save_dashboard(zip_dashboard: bool = False) → None[source]

Creates the dashboard directory, copies the web application based on the template name, saves the dashboard data.

Parameters

zip_dashboard – enable it in order to zip the directory for downloading. default: False

Returns

None

serve_dashboard_from_local_server(mode: str = 'server', port: int = None, load_existing_dashboard: bool = False) → None[source]

Serve the dashboard to the user using a web server. Available modes:

  • ‘server’: will open a new tab in the default browser using webbrowser package

  • ‘js’: will open a new tab in the default browser using IPython

  • ‘jupyter’: will open the dashboard in a jupyter notebook

Parameters
  • mode – the selected web server mode. default: ‘server’

  • port – the server port. default: None. a random port will be generated between (1024-49151)

  • load_existing_dashboard – Load existing dashboard data.

Returns

None

update_charts(new_charts: List[dict], keep_existing=True) → None[source]

Update the dashboard charts. If keep_existing is True, the dashboard’s charts will be extended otherwise it will be replaced.

Parameters
  • new_charts – List of dict representing the new charts

  • keep_existing – boolean to flag whether existing charts should be extended.

Returns

None

update_number_displays(new_number_displays: List[dict], keep_existing=True) → None[source]

Update the dashboard number displays. If keep_existing is True, the dashboard’s number displays will be extended otherwise it will be replaced.

Parameters
  • new_number_displays – List of dict representing the new number displays

  • keep_existing – boolean to flag whether existing charts should be extended.

Returns

None