An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          


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

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