Skip to main content

Client-side Python SPA framework via Pyodide

Project description

Wybthon

Build interactive web apps in Python, no JavaScript required.

CI Release PyPI Version Python Versions License: MIT Docs

Documentation · Getting Started · Examples · Contributing


Overview

Wybthon is a client-side SPA framework that lets you build interactive web applications entirely in Python. Powered by Pyodide, it runs in the browser and provides a signals-first reactive model inspired by SolidJS. With fine-grained reactivity, a virtual DOM, component model, routing, forms, and context, you can write modern frontends without touching JavaScript.

Features

  • Run-once components + reactive holes: function bodies run a single time at mount. Embed a signal getter anywhere in your VNode tree and the reconciler wires it as a reactive hole: only that DOM node updates when the signal changes. No React-style re-renders.
  • Signals-first reactivity: Fine-grained updates with create_signal, create_effect, create_memo, batch, untrack, and on.
  • Virtual DOM: Function components with efficient, batched diffing, amortising the Pyodide ↔ JS bridge cost while keeping SolidJS-style fine-grained updates above it.
  • Client-side router: Path parameters, query parsing, Link component, and programmatic navigation.
  • Context API: Share state across the component tree with create_context and use_context.
  • Forms and validation: Built-in form state management with validators and two-way bindings.
  • Flow control primitives: Show, For, Index, Switch, Match, and Dynamic for declarative rendering.
  • Error boundaries and Suspense: Graceful error handling and async loading states.
  • Dev server with hot reload: wyb dev launches a local server with SSE-based auto-reload.

Quick Start

Installation

pip install wybthon

Usage

from wybthon import button, component, create_signal, div, p, span


@component
def Counter(initial: int = 0):
    count, set_count = create_signal(initial)
    # The body runs ONCE.  ``count.get`` is a reactive hole, so only the
    # text node inside the span updates when the signal changes.
    return div(
        p("Count: ", span(count.get)),
        button("Increment", on_click=lambda e: set_count(count() + 1)),
    )

Documentation

Visit wybthon.com for the full documentation, including getting started guides, core concepts, API reference, and working examples.

Contributing

Contributions are welcome. Please see CONTRIBUTING.md for setup instructions, coding standards, and guidelines for submitting pull requests.

License

MIT

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

wybthon-0.25.0.tar.gz (133.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wybthon-0.25.0-py3-none-any.whl (98.7 kB view details)

Uploaded Python 3

File details

Details for the file wybthon-0.25.0.tar.gz.

File metadata

  • Download URL: wybthon-0.25.0.tar.gz
  • Upload date:
  • Size: 133.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wybthon-0.25.0.tar.gz
Algorithm Hash digest
SHA256 d1a70d35a931255c7a4927dc54257759962d3cad4f67b05a86cec6dc1cf6a914
MD5 7e17081c0c0ad1f1953bb2f5a7d992a9
BLAKE2b-256 cb6f1edea63252d04780cb96eb641b1e40d3f11505b168138c5c4b4990a9456e

See more details on using hashes here.

Provenance

The following attestation bundles were made for wybthon-0.25.0.tar.gz:

Publisher: release.yml on wybthon/wybthon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wybthon-0.25.0-py3-none-any.whl.

File metadata

  • Download URL: wybthon-0.25.0-py3-none-any.whl
  • Upload date:
  • Size: 98.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wybthon-0.25.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9dfbfcc220c78e9fb01e144b4a6758066c25d1a7f2d1fc6217ea072bbbb07543
MD5 aca35938f6ad0758cfd24ccf82b2880c
BLAKE2b-256 21656dbd2e58a743a7a8ba4f86e1d949053960236b7323756307d79e99c61753

See more details on using hashes here.

Provenance

The following attestation bundles were made for wybthon-0.25.0-py3-none-any.whl:

Publisher: release.yml on wybthon/wybthon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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