a simple way of launching dashboards directly from the commandline

With dash_oop_components you can easily dump the configuration for a dash dashboard to a configuration .yaml file. Along with the library a dashapp command line tool (CLI) gets installed to make it easy to directly launch a dashboard from the commandline.

This is useful for when:

  • you quickly want to launch a dashboard without starting python or jupyter, or finding the correct gunicorn config
  • you want to instruct others how to easily launch your dashboard without messing around with python or gunicorn

dashapp command line tool

You first need to store your dash app to a config yaml file using e.g

db = DashApp(dashboard_component, port=8000, querystrings=True, bootstrap=True)
db.to_yaml("dashboard.yaml")

You can then run the app directly from the commandline and have it opened in a browser:

$ dashapp dashboard.yaml

To try loading the figure factory from pickle, add the --try-pickles flag:

$ dashapp --try-pickles dashboard.yaml

You can also store a DashComponent and run it from the command-line, by saving it to yaml:

dashboard_component = CovidDashboard(plot_factory)
dashboard_component.to_yaml("dashboard_component.yaml")

And running it:

$ dashapp dashboard_component.yaml

To include the bootstrap css and store parameters in url querystring and set port to 9000:

$ dashapp dashboard_component.yaml --querystrings --bootstrap --port 9000

If you follow the naming convention of storing the yaml to dashboard.yaml, or dashboard_component.yaml, you can omit the argument and simply run:

$ dashapp
Options:
  -nb, --no-browser     Launch a dashboard, but do not launch a browser.
  -tp, --try-pickles    if DashFigureFactory parameter config has filepath
                        defined, try to load it from pickle.

  -fp, --force-pickles  if DashFigureFactory parameter config has filepath
                        defined, load it from pickle or raise exception.

  -q, --querystrings    Store state in url querystring
  -b, --bootstrap       include default bootstrap css
  -p, --port INTEGER    specific port to run dashboard on
  --help                Show this message and exit.

[source]

(*args, **kwargs)

dashapp is a CLI tool from the dash_oop_components library, used to launch a dash app from the commandline.

You first need to store your dash app to a config yaml file using e.g

 db = DashApp(dashboard_component, port=8000) db.to_yaml("dashboard.yaml")

 You can then run the app directly from the commandline with and open it in a browser:

$ dashapp dashboard.yaml

or try the load figure factory from pickle:

$ dashapp --try-pickles dashboard.yaml


You can also store and run a DashComponent, by saving it to yaml:

 dashboard_component = CovidDashboard(plot_factory) dashboard_component.to_yaml("dashboard_component.yaml")

And running it:

$ dashapp dashboard_component.yaml

To include the bootstrap css and store parameters in url querystring:

$ dashapp dashboard_component.yaml --querystrings --bootstrap

If you follow the naming convention of storing the yaml to dashboard.yaml, or dashboard_component.yaml, you can omit the argument and simply run:

$ dashapp