Skip to main content

StarHTML — Python Web Framework

StarUI — Python Component Library

PyPI Version License

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starhtml-0.7.0.tar.gz (626.1 kB view details)

Uploaded Source

Built Distribution

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

starhtml-0.7.0-py3-none-any.whl (163.7 kB view details)

Uploaded Python 3

File details

Details for the file starhtml-0.7.0.tar.gz.

File metadata

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

File hashes

Hashes for starhtml-0.7.0.tar.gz
Algorithm Hash digest
SHA256 0cdb90dbc25af666a11f17f2a9483f788cf9d5f83940777906d2ed4b657ba84b
MD5 4170da0480a590feaf52460fd1a89a27
BLAKE2b-256 72f4dc3a4ef5646f101da020960a7f06cb2ccc4b6386546ee896f7058a1b487f

See more details on using hashes here.

Provenance

The following attestation bundles were made for starhtml-0.7.0.tar.gz:

Publisher: release.yml on banditburai/starHTML

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

File details

Details for the file starhtml-0.7.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for starhtml-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3515ac3a21f1be7ce3e724b45440ed2be20d3afcdb60f92f6ebbfaec883d3ea2
MD5 e7b4c45ebfcdaaa6b5cf23734a1487db
BLAKE2b-256 644ef4c3e0e3c285d9f273ad7ea1776e0bf8afc78ec8f65db7704ec90a4e639b

See more details on using hashes here.

Provenance

The following attestation bundles were made for starhtml-0.7.0-py3-none-any.whl:

Publisher: release.yml on banditburai/starHTML

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

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 files

0.6.1

2 files

0.6.0

2 files

0.5.24

2 files

0.5.23

2 files

0.5.22

2 files

0.5.21

2 files

0.5.20

2 files

0.5.19

2 files

0.5.18

2 files

0.5.17

2 files

0.5.16

2 files

0.5.15

2 files

0.5.14

2 files

0.5.13

2 files

0.5.12

2 files

0.5.11

2 files

0.5.10

2 files

0.5.9

2 files

0.5.8

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.26

2 files

0.1.25

2 files

0.1.24

2 files

0.1.23

2 files

0.1.22

2 files

0.1.21

2 files

0.1.20

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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