Async Web Framework
Project description
Dazzler
Dazzler is a Python (>=3.6) async web framework. Create dazzling fast pages with a layout of python components and bindings to update from the backend.
Install
Install with pip: $ pip install dazzler
Features
- Fast WebSocket based communication, deliver updates in realtime to thousands of connected clients at once.
- Lightweight bundles for fast initial page load.
- Support for third party integrations via middlewares.
- Session & authentication systems.
- No HTML/CSS/JS knowledge required, write everything with Python.
- Multi page based.
- Hot reload.
- Tons of components.
Basic example
Create a page with a layout and assign a binding to set the output component children when clicked on.
from dazzler import Dazzler
from dazzler.system import Page, Trigger, BindingContext
from dazzler.components import core
app = Dazzler(__name__)
page = Page(
'my-page',
core.Container([
core.Html('H2', 'My dazzler page'),
core.Input(identity='input', placeholder='Enter name'),
core.Button('Click me', identity='click-me'),
core.Container(identity='output')
])
)
app.add_page(page)
@page.bind(Trigger('click-me', 'clicks'))
async def on_click(context: BindingContext):
name = await context.get_aspect('input', 'value')
await context.set_aspect(
'output', children=f'Hello {name}'
)
if __name__ == '__main__':
app.start()
Documentation
Full documentation hosted on readthedocs.
Get help for the command line tools: $ dazzler --help
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dazzler-0.4.0.tar.gz
(1.7 MB
view details)
File details
Details for the file dazzler-0.4.0.tar.gz
.
File metadata
- Download URL: dazzler-0.4.0.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee4bb22f301f2dcb4cd25c02f4cbb66be29110aefd3316f73823a5e287235582 |
|
MD5 | 1f1f77dc6e7b2d0705c90ca03f13c076 |
|
BLAKE2b-256 | 89b8bf3b80318e81bba42d9ef7b7fbaa9c42b83ce06bb0dfafdd19e8e433aeda |