https://github.com/wybthon/wybthon
Experimental client‑side Python web framework (Pyodide/WebAssembly) with VDOM, signals, components, and a tiny router for building reactive SPAs.
https://github.com/wybthon/wybthon
browser client-side component-based components context-api frontend hyperscript pyodide python reactivity router signals single-page-application spa state-management vdom virtual-dom wasm web-framework webassembly
Last synced: 7 days ago
JSON representation
Experimental client‑side Python web framework (Pyodide/WebAssembly) with VDOM, signals, components, and a tiny router for building reactive SPAs.
- Host: GitHub
- URL: https://github.com/wybthon/wybthon
- Owner: wybthon
- Created: 2025-09-06T07:26:53.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-10-01T20:16:13.000Z (6 months ago)
- Last Synced: 2025-10-01T20:32:39.039Z (6 months ago)
- Topics: browser, client-side, component-based, components, context-api, frontend, hyperscript, pyodide, python, reactivity, router, signals, single-page-application, spa, state-management, vdom, virtual-dom, wasm, web-framework, webassembly
- Language: Python
- Homepage: https://docs.wybthon.com/
- Size: 881 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
Build interactive web apps in Python, no JavaScript required.
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
- **Signals-first reactivity:** Fine-grained updates with `create_signal`, `create_effect`, `create_memo`, and `batch`.
- **Virtual DOM:** Function components with efficient diffing and reconciliation.
- **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
```bash
pip install wybthon
```
### Usage
```python
from wybthon import button, component, create_signal, div, p
@component
def Counter(initial: int = 0):
count, set_count = create_signal(initial)
def render():
return div(
p(f"Count: {count()}"),
button("Increment", on_click=lambda e: set_count(count() + 1)),
)
return render
```
## Documentation
Visit [docs.wybthon.com](https://docs.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](CONTRIBUTING.md) for setup instructions, coding standards, and guidelines for submitting pull requests.
## License
[MIT](LICENSE)