Skip to content

Commit

Permalink
Rename the package to async-dash
Browse files Browse the repository at this point in the history
  • Loading branch information
snehilvj committed Feb 4, 2022
1 parent 924dc35 commit 30e54ea
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 19 deletions.
59 changes: 44 additions & 15 deletions README.md
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.
28 changes: 26 additions & 2 deletions asetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand All @@ -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",
],
)
2 changes: 1 addition & 1 deletion dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
)


_flask_compress_version = parse_version(get_distribution("flask-compress").version)
# _flask_compress_version = parse_version(get_distribution("flask-compress").version)

# Add explicit mapping for map files
mimetypes.add_type("application/json", ".map", True)
Expand Down
2 changes: 1 addition & 1 deletion requires-install.txt
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
Expand Down

0 comments on commit 30e54ea

Please sign in to comment.