Skip to main content

Async Web Framework

Project description

Dazzler

Build Documentation Status Version License

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

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()

Project details


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.2.0rc1.tar.gz (1.6 MB view details)

Uploaded Source

File details

Details for the file dazzler-0.2.0rc1.tar.gz.

File metadata

  • Download URL: dazzler-0.2.0rc1.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for dazzler-0.2.0rc1.tar.gz
Algorithm Hash digest
SHA256 f3de5b5ee31239eac25eb476abae4ab3a30985102e5db1e086b71139fbcd23e4
MD5 03806efe1989ffc6a53833878f55a4bd
BLAKE2b-256 1413ca6b82de2894fe84da10a81d3ecdb67ad2bcb056a3caee44ee09372d1ca8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page