Skip to main content

🛠️ dash-tools - Create and Deploy Plotly Dash Apps from Command Line

GitHub | Pypi | Downloads | Build and Test | Code Quality | License

Create a templated multi-page Plotly Dash app with CLI in less than 7 seconds. Deploy your app to Heroku in under a minute!

About

dash-tools is an open-source toolchain for Plotly Dash Framework. With a user-friendly command line interface, creating Dash applications has never been quicker.

Includes user and developer-friendly app templates where generating a new app only takes seconds. In fact, it will take longer to install this tool than it will to use it!

Want to deploy your app to the web? We've got you covered. With Heroku support, deploying your project will take under a minute.

Installation

Ready to use dash-tools? Installation is easy with pip:

pip install dash-tools

Requires:

  • Heroku CLI which can be downloaded Here
  • Git CLI which can be downloaded Here

Find dash-tools on PyPi

Usage Examples

Below are common usage examples. For a more in-depth tutorial on writing apps for Plotly Dash, see the Plotly Dash Documentation. For information about dash-tools commands, read the Commands section.

Creating A New Project

For a more in-depth tutorial on using dash-tools, check out the Create and Upload Your App document!

Creating a new Dash project is very simple. The following command will create a new directory called "MyDashApp":

dash-tools --init MyDashApp

Optionally, templates can be used. Check out Templates for more details.

You can see what files are included with your new app:

cd MyDashApp

You can make changes to your app in the src/app.py file! See Plotly Dash Layout Docs for more information, or check out the dash-tools docs on Configuring Your Dash App.

When you are happy with your changes, run your dash app locally with the following command. You will be able to view your app at http://127.0.0.1:8050/ in your browser:

python src/app.py

Loading CSV Files

A common use for Dash is to display CSV data. To see an example, use the following command to create a "MyCSVApp" app with the 'csv' template:

dash-tools --init MyCSVApp csv

See the Templates section for more details on using templates.

Deploying To Heroku

Deploying your project online to Heroku is simple. The CLI handles both creating and deploying a new app, as well as updating an existing app.

Using dash-tools to Create An App

To create an app, run the following command from your project's root directory; e.g. /MyDashApp from the example above. Next, follow the simple on-screen directions and deployment will be handled for you:

dash-tools --deploy-heroku

Optionally, you can specify a heroku app name as an argument. If one is not provided, you will be prompted to enter one or generate one automatically.

Note: "some-unique-heroku-app-name" in the example below is a name that you should change!

dash-tools --deploy-heroku some-unique-heroku-app-name

And that's really it! You will be prompted to log into your heroku account, a git remote 'heroku' will be created and changes will be pushed and deployed automatically.

Uploading Your Existing (non dash-tools) Dash App

Uploading an existing application without using a dash-tools templated app is easy. You need to make sure of the following:

  • Your project contains src/app.py application file
  • Your src/app.py file contains the server = app.server declaration for heroku

Since the deploy command will create your Procfile, runtime.txt and requirements.txt files for you, there is no need to worry about creating them yourself.

To deploy, the next steps will be the same as above.

Pushing Changes to an Existing Heroku Remote

To push changes to an existing heroku app after it is deployed, you can use the same command as before. Since a 'heroku' git remote already exists, by choosing the on-screen option to "Update Existing App", all changes will be pushed and your app will be re-deployed:

dash-tools --deploy-heroku

If you would rather add specific files, make a commit and push to the 'heroku' remote manually:

git add SomeFileYouModified.txt
git commit -m "Your Commit Message"
git push heroku

Templates

Templates contain boilerplate code for Dash projects, making it much easier to start with useful baseline apps.

Using Templates

Use the optional template argument with the --init command.

The following example will create a new app "MyWonderfulApp" (you can name your app anything) using the 'tabs' template (or any other template listed below):

dash-tools --init MyWonderfulApp tabs

To list out available templates, use the --templates or -t command:

dash-tools --templates

Available Templates

Click the dropdowns below to see screenshots!

Template: 'advanced'

To use this template, type: dash-tools --init MyFuturisticApp advanced

Advanced multi-page template. Includes examples of ClientsideCallbacks, multi-page routing, external stylesheets, header, footer, and 404 page.

Template: 'csv'

To use this template, type: dash-tools --init MyCSVLoaderApp csv

Example of CSV file loading. Includes the default CSV load example from Plotly.

Template: 'default'

To use this template, type: dash-tools --init MyAmazingApp default

Basic Dash template. See Dash Docs

Template: 'iris'

To use this template, type: dash-tools --init MyFantasticApp iris

Iris theme. See Faculty.ai Example

Template: 'mantine'

To use this template, type: dash-tools --init MyGreatApp mantine

Basic mantine template. See Dash Mantine

Template: 'multipage'

To use this template, type: dash-tools --init MyPristineApp multipage

New multipage theme. See Multipage Plugin

Template: 'sidebar'

To use this template, type: dash-tools --init MySnazzyApp sidebar

Sidebar theme. See Faculty.ai Example

Template: 'tabs'

To use this template, type: dash-tools --init MyBeautifulApp tabs

Tabs theme with dynamically generated content. See Faculty.ai Example

Commands

Project Commands

  • --deploy-heroku Args: OPTIONAL (unique heroku project name) : Deploys the project to Heroku using the Heroku CLI (Must Install Seperately) and Git. Invoke from the project root directory.
  • --init, -i Args: REQUIRED (project name) OPTIONAL (template) : Creates a Plotly Dash app with the given name in the current working directory. Optional args specified can be used for templates.
  • --templates, -t : List available templates.

Other

  • --help, -h: Display CLI helpful hints
  • --version: Display current version.

Troubleshooting Common Issues

Running into issues? Outlined below are common errors and solutions. If you do not find an answer below, please Submit an Issue Ticket.

Common --init Issues

No write permission

Problem: You receive a 'write permission' error while trying to init a new app

Solution: Please check your write permissions for the current directory. Try the init command from a different directory.

Common --deploy-heroku Issues

Error when creating requirements.txt file

Problem: You encounter an error when generating a requirements.txt file

Solution: Verify that you are running the dash-tools --deploy-heroku command from a valid plotly dash app directory. E.g. there is a src/app.py file.

Development

See the Developer Guide for more details.

License

MIT License. See LICENSE.txt file.

Metadata

Release files for dash-tools 1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dash-tools 1.3
File Size Uploaded
dash-tools-1.3.tar.gz 4.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for dash-tools 1.3
File Interpreter ABI Platform
dash_tools-1.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 MB

Release files / dash-tools-1.3.tar.gz

Download URL dash-tools-1.3.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
ff7ed54fce3c54a4e58a55e6e46881031575c1f10604a70d6e1eef7809ce50bb
BLAKE2b-256 checksum
How to use checksums
16b69097a9541484aed59af1af94e8689e6361951d319429657e6cc09a703af3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / dash_tools-1.3-py3-none-any.whl

Download URL dash_tools-1.3-py3-none-any.whl
Size 4.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
21ce812b6b9d89055b1412a765329a77cc0936ca3cd3d2cf4e8b91691e91d2eb
BLAKE2b-256 checksum
How to use checksums
efb980902fa4cab0987ff166675af84fcaac96f4822a18d758215438f7659430
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release history Release notifications | RSS feed

1.12.0

2 release files

1.10.8

2 release files

1.10.7

2 release files

1.10.6

2 release files

1.10.5

2 release files

1.10.4

2 release files

1.10.3

2 release files

1.10.2

2 release files

1.10.1

2 release files

1.9.2

2 release files

1.9.1

2 release files

1.8.4

2 release files

1.8.3

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.3

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5

2 release files

1.4

2 release files

This release

1.3 This release

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

0.20

2 release files

0.19

2 release files

0.16

2 release files

0.14

1 release file

0.13

1 release file

0.12

1 release file

0.11

1 release file

0.10

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page