forked from plotly/dash
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
72 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,68 @@ | ||
# ADash | ||
## Async Dash | ||
|
||
`adash` is an async port of [Plotly Dash](https://github.com/plotly/dash) library, created by replacing its flask backend | ||
with its async counterpart: [quart](https://pgjones.gitlab.io/quart/index.html). | ||
`async-dash` is an async port of [Plotly Dash](https://github.com/plotly/dash) library, created by replacing its flask | ||
backend with its async counterpart [quart](https://pgjones.gitlab.io/quart/index.html). | ||
|
||
It started with my need to be able to create realtime dashboards with `dash`, specifically with event-driven architecture. | ||
Using `adash` with components from [dash-extensions](https://github.com/thedirtyfew/dash-extensions) such as WebSocket, | ||
EventSource, etc. you can create truly events based dashboards. | ||
It started with my need to be able to create realtime dashboards with `dash`, specifically with event-driven | ||
architecture. Using `async-dash` with components from [dash-extensions](https://github.com/thedirtyfew/dash-extensions) | ||
such as WebSocket, EventSource, etc. you can create truly events based dashboards. | ||
|
||
#### Table Of Contents | ||
|
||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
- [Motivation](#motivation) | ||
- [Caveats](#caveats) | ||
- [Alternatives](#alternatives) | ||
- [Known Issues](#known-issues) | ||
- [TODO](#todo) | ||
|
||
### Installation | ||
|
||
```bash | ||
pip install async-dash | ||
``` | ||
|
||
### Usage | ||
|
||
```python | ||
from dash import Dash, html, dcc, Output, Input | ||
``` | ||
|
||
### Motivation | ||
|
||
In addition to all the advantages of writing async code, `adash` enables you to: | ||
In addition to all the advantages of writing async code, `async-dash` enables you to: | ||
|
||
1. run truly asynchronous callbacks | ||
2. use websockets, server sent events, etc. without needing to monkey patch the Python standard library | ||
3. use `quart` / [`fastapi`](https://fastapi.tiangolo.com) / [`starlette`](https://www.starlette.io) frameworks with your dash apps side by side | ||
4. use HTTP/2 (especially server push) if you use it HTTP/2 enabled server such as [`hypercorn`](https://pgjones.gitlab.io/hypercorn/). | ||
3. use `quart` / [`fastapi`](https://fastapi.tiangolo.com) / [`starlette`](https://www.starlette.io) frameworks with | ||
your dash apps side by side | ||
4. use HTTP/2 (especially server push) if you use it HTTP/2 enabled server such | ||
as [`hypercorn`](https://pgjones.gitlab.io/hypercorn/). | ||
|
||
### Cons | ||
### Caveats | ||
|
||
I'm maintaining this library as a proof of concept for now. It should not be used for production. You can see the deviation from `dash` [here](https://github.com/snehilvj/adash/compare/dev...snehilvj:async-dash). | ||
I'm maintaining this library as a proof of concept for now. It should not be used for production. You can see the | ||
deviation from `dash` [here](https://github.com/snehilvj/async-dash/compare/dev...snehilvj:async-dash). | ||
|
||
If you do decide to use it, I'd love to hear your feedback. | ||
|
||
### Alternatives | ||
|
||
#### [dash-devices](https://github.com/richlegrand/dash_devices) | ||
|
||
`dash-devices` is another async port based on `quart`. Its capable os using websockets even for callbacks, which makes | ||
it way faster than either of `dash` or `adash`. However, the library stands outdated at the time this document was last updated. | ||
`dash-devices` is another async port based on `quart`. It's capable of using websockets even for callbacks, which makes | ||
it way faster than either of `dash` or `async-dash`. However, the library stands outdated at the time this document was | ||
last updated. | ||
|
||
**PS:** `adash` is highly inspired by the `dash-devices`. Difference being that `adash` tries to follow `dash` as close as possible. | ||
**PS:** `async-dash` is highly inspired by the `dash-devices`. Difference being that `async-dash` tries to follow `dash` | ||
as close as possible. | ||
|
||
### Known Issues | ||
|
||
1. Exception handling in callbacks is broken. | ||
1. Exception handling in callbacks in **debug mode** is broken. | ||
|
||
### TODO | ||
|
||
1. Write examples/articles showcasing the use cases for asynchronous `dash`. | ||
2. Gather reviews and feedback from the Dash Community. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ def read_req_file(req_type): | |
|
||
|
||
setup( | ||
name="adash", | ||
name="async-dash", | ||
version=main_ns["__version__"], | ||
author="Snehil Vijay", | ||
author_email="[email protected]", | ||
|
@@ -25,5 +25,29 @@ def read_req_file(req_type): | |
long_description_content_type="text/markdown", | ||
install_requires=read_req_file("install"), | ||
python_requires=">=3.7", | ||
url="https://github.com/snehilvj/dash", | ||
url="https://github.com/snehilvj/async-dash", | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Web Environment", | ||
"Framework :: Dash", | ||
"Framework :: Flask", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Education", | ||
"Intended Audience :: Financial and Insurance Industry", | ||
"Intended Audience :: Healthcare Industry", | ||
"Intended Audience :: Manufacturing", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Topic :: Database :: Front-Ends", | ||
"Topic :: Office/Business :: Financial :: Spreadsheet", | ||
"Topic :: Scientific/Engineering :: Visualization", | ||
"Topic :: Software Development :: Libraries :: Application Frameworks", | ||
"Topic :: Software Development :: Widget Sets", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
quart>=1.0.4 | ||
quart | ||
quart-compress | ||
plotly>=5.0.0 | ||
dash_html_components==2.0.0 | ||
|