A Python-first hypermedia framework, forked from FastHTML. Uses Datastar instead of HTMX for the same hypermedia-driven approach with a different flavor.
Documentation · UI Components · Quick Start · Community · Issues
Key Features
- Python-First — Write reactive UIs using Python syntax with type safety and IDE support
- Reactive Signals — Hypermedia approach with data-attribute-powered client-side reactivity where needed
- Server-Sent Events — Built-in SSE support for real-time server interactions
- Framework Agnostic — Works with any CSS framework (Tailwind, DaisyUI)
- JavaScript Escape Hatch — Drop into raw JavaScript when needed for complex interactions
Quick Start
pip install starhtml
from starhtml import *
app, rt = star_app()
@rt('/')
def home():
return Div(
H1("StarHTML Demo"),
# Define reactive state with signals
Div(
(counter := Signal("counter", 0)), # Python-first signal definition
# Reactive UI that updates automatically
P("Count: ", Span(data_text=counter)),
Button("+", data_on_click=counter.add(1)),
Button("Reset", data_on_click=counter.set(0)),
# Conditional styling
data_class_active=counter > 0
),
# Server-side interactions
Button("Load Data", data_on_click=get("/api/data")),
Div(id="content")
)
@rt('/api/data')
def api_data():
return Div("Data loaded from server!", id="content")
serve()
Run with python app.py and visit http://localhost:5001.
What's Different?
| FastHTML | StarHTML |
|---|---|
| HTMX for server interactions | Datastar for reactive UI |
| Built with nbdev notebooks | Standard Python modules |
| Multiple JS extensions | Single reactive framework |
| WebSockets for real-time | SSE for real-time |
Development
git clone https://github.com/banditburai/starhtml.git
cd starhtml
uv sync # or pip install -e ".[dev]"
pytest && ruff check .
Contributions welcome — see CONTRIBUTING.md.
Acknowledgments
StarHTML is a fork of FastHTML. Built on Datastar for client-side reactivity.
Metadata
Release files for starhtml 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| starhtml-0.7.0.tar.gz | 626.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| starhtml-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 789.8 kB
Release files / starhtml-0.7.0.tar.gz
| Download URL | starhtml-0.7.0.tar.gz |
|---|---|
| Size | 626.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cdb90dbc25af666a11f17f2a9483f788cf9d5f83940777906d2ed4b657ba84b
|
|
BLAKE2b-256 checksum How to use checksums |
72f4dc3a4ef5646f101da020960a7f06cb2ccc4b6386546ee896f7058a1b487f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 6, 2026.
Transparency logRelease files / starhtml-0.7.0-py3-none-any.whl
| Download URL | starhtml-0.7.0-py3-none-any.whl |
|---|---|
| Size | 163.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3515ac3a21f1be7ce3e724b45440ed2be20d3afcdb60f92f6ebbfaec883d3ea2
|
|
BLAKE2b-256 checksum How to use checksums |
644ef4c3e0e3c285d9f273ad7ea1776e0bf8afc78ec8f65db7704ec90a4e639b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 6, 2026.
Transparency log