SolidJS for Python. Build interactive web apps in Python, no JavaScript required.
Documentation · Getting Started · Examples · Contributing
Overview
Wybthon brings SolidJS 2.0's reactive model to Python and runs it in the browser through Pyodide. You write run-once function components, return a tree of HTML helpers, and drop signals, memos, and small reactive expressions ("holes") into that tree. When a signal changes, only the holes that read it re-run; components never re-render. Async data, loading and error boundaries, actions with optimistic state, draft-first stores, a router, forms, and context are all built in.
Features
- Run-once components with typed props.
@componentfunctions run once at mount. Every parameter is aProp[T]accessor: call it for a tracked read,.peek()for a one-time read, or place it in the tree to bind it. - Reactive holes, not re-renders. Any zero-argument callable or accessor placed in the tree becomes its own render effect. A signal write re-runs only the holes that depend on it.
- Signals with automatic batching.
create_signal,create_memo, andcreate_effect. Writes are staged and applied once per microtask (and at the end of every event handler), so there is nobatch()to remember. - Async-first data. An
async defpassed tocreate_memois the data-fetching primitive.Loadingshows a fallback until it resolves; later refetches run as transitions that hold the dependent UI on the old state until the new value lands, so the screen never tears.is_pending,latest,resolve, andrefreshobserve or drive it, andactionmakes a mutation a transaction with optimistic state that reverts on its own. - Actions and optimistic state.
actiontracks in-flight mutations;create_optimisticandcreate_optimistic_storehold temporary values that revert when the actions settle. - Draft-first stores.
create_storesetters take a function that mutates a draft with plain Python; reads are tracked per path.reconcile,snapshot,deep, derived stores, and projections are included. - Flow control.
Show,For,Repeat,Switch/Match, andDynamiccreate isolated reactive scopes so only the affected subtree updates. - Boundaries.
Loading,Reveal, andErroredkeep content mounted while pending and swap in fallbacks without tearing down sibling trees. - Virtual DOM behind the scenes. Every DOM mutation is batched through a small JS kernel in a single Python-to-JS crossing, and static subtrees mount from cloned templates.
- Router, forms, context, portals, lazy components.
Router,Route,Link,form_statewith validators and ARIA helpers, callableContextobjects,Portal, andlazy. - Dev mode diagnostics. Writes inside a tracking scope raise
WriteInScopeError; untracked reads at the top of a component body warn. - Dev server with hot reload.
wyb devserves your project and reloads the page over Server-Sent Events.
Quick start
Installation
Wybthon requires Python 3.12 or newer.
pip install wybthon
Inside Pyodide, install at runtime with micropip:
import micropip
await micropip.install("wybthon")
Usage
from wybthon import (
Errored,
For,
Loading,
Prop,
Show,
action,
button,
component,
create_memo,
create_signal,
create_store,
div,
input_,
li,
p,
prop,
render,
ul,
)
@component
def Counter(step: Prop[int] = prop(1)):
count, set_count = create_signal(0)
doubled = create_memo(lambda: count() * 2)
return div(
p("Count: ", count, " (doubled: ", doubled, ")"),
button("+", on_click=lambda e: set_count(lambda n: n + step())),
Show(lambda: count() > 5, lambda: p("That's a lot of clicks.")),
)
@component
def Todos():
store, set_store = create_store({"items": []})
draft, set_draft = create_signal("")
@action
async def add(title: str):
set_store(lambda s: s["items"].append({"id": len(s["items"]) + 1, "title": title}))
set_draft("")
return div(
input_(value=draft, on_input=lambda e: set_draft(e.target.value)),
button("Add", on_click=lambda e: add(draft.peek()), disabled=add.pending),
ul(For(lambda: store["items"], lambda item, i: li(lambda: item()["title"]), keyed=lambda t: t["id"])),
)
@component
def App():
return Errored(
lambda: Loading(lambda: div(Counter(step=2), Todos()), fallback=p("Loading...")),
fallback=lambda err, reset: div(p("Something went wrong: ", str(err)), button("Retry", on_click=lambda e: reset())),
)
render(App(), "#app")
Documentation
Visit wybthon.com for the full documentation, including getting started guides, core concepts, API reference, working examples, and migration guides from React, Solid, and earlier Wybthon releases.
Contributing
Contributions are welcome. Please see CONTRIBUTING.md for setup instructions, coding standards, and guidelines for submitting pull requests.
License
Metadata
Release files for wybthon 0.33.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wybthon-0.33.1.tar.gz | 205.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wybthon-0.33.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 376.9 kB
Release files / wybthon-0.33.1.tar.gz
| Download URL | wybthon-0.33.1.tar.gz |
|---|---|
| Size | 205.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3bfe9afa8bc7bad9c229f9baa7a21e29eef741e4e31f44a5d90f6573017e85eb
|
|
BLAKE2b-256 checksum How to use checksums |
62302c200ce1b1e587b1c1b7798828929712322aa4cc550fae3fc480f8bf5cb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 6, 2026.
Transparency logRelease files / wybthon-0.33.1-py3-none-any.whl
| Download URL | wybthon-0.33.1-py3-none-any.whl |
|---|---|
| Size | 171.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c69b2a7e213bd4a835ee27629a3cda2123a7504605a93d87854d1b5b0729686d
|
|
BLAKE2b-256 checksum How to use checksums |
141ab709115d63ae92ad4049fd91a22ab82951355fb844767495f2ae3dacfe76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 6, 2026.
Transparency log