hedron
FastAPI-native typed component framework for HTML and HTMX.
Build dashboards, admin tools, and CRUD apps as typed Python components — without a
Node.js frontend stack. Hedron extends FastAPI with pages, addressable components,
typed actions, CSRF-aware forms, HTMX fragment/OOB policy, OpenAPI text/html
metadata, interaction built-ins (Lazy, Poll, Pagination, …), caching
(cache_data / cache_component), ColorMode persistence, a thin Hedron()
application facade, CLI (new / check / graph / build / …), plugin loading,
and public hedron.testing helpers.
Built on framework-neutral hedron-core.
Flask and Django hosts use hedron-flask
and hedron-django.
Package maturity: Beta · Train: 0.20.0 (Published) · pin >=0.20.0,<0.21
Most public APIs remain compatibility level beta until listed in the small
stable table.
Capability readiness:
What’s ready today.
Install
pip install "hedron>=0.20.0,<0.21"
# or
uv add "hedron>=0.20.0,<0.21"
Requires Python 3.11–3.14.
Optional extras
| Extra | Installs |
|---|---|
data |
hedron-data (DataTable / DataEditor) |
jinja |
hedron-jinja (.hdj templates) |
dev |
hedron-explorer (Component Explorer) |
extras |
hedron-extras (workbenches) |
conformance |
hedron-conformance |
charts |
hedron-charts (Alpha 0.1.x) |
native |
hedron-native (Alpha) |
notebook / mcp / gradio |
Experimental Alpha packages |
markdown / code / images / email / sanitize |
Content helpers |
auth |
Authlib OIDC helpers |
browser |
Playwright + axe helpers |
otel |
OpenTelemetry hooks |
pip install "hedron[data,dev]>=0.20.0,<0.21"
pip install "hedron[charts]>=0.1.0,<0.2" # Alpha — pin and expect churn
Quick start
Scaffold an app with a working HTMX Refresh status control:
# Need uv? https://docs.astral.sh/uv/getting-started/installation/
uvx --from "hedron>=0.20.0,<0.21" hedron new my-hedron-app
cd my-hedron-app && uv sync && uv run uvicorn app:app --reload
Open http://127.0.0.1:8000 — click Refresh status; the timestamp updates via an HTMX fragment swap.
Full walkthrough: Build your first app.
Minimal app
from hedron import Hedron, Page, Text
app = Hedron(
title="Demo",
security="standard",
session_secret="replace-in-production",
explorer="off",
)
@app.page("/")
def home() -> Page:
return Page(Text("Hello, Hedron"), title="Demo")
pip install "hedron>=0.20.0,<0.21" "uvicorn[standard]"
uvicorn app:app --reload
Plain FastAPI
from fastapi import FastAPI
from hedron import HTML, HedronRouter, Text, hedron_response, mount_hedron_static
from hedron.security.policy import SecurityPolicy
app = FastAPI()
app.state.hedron_security = SecurityPolicy.from_name("standard")
mount_hedron_static(app)
router = HedronRouter()
@router.get("/card", **hedron_response())
def card():
return HTML(Text("plain"))
app.include_router(router)
CLI
hedron new demoapp
cd demoapp
hedron --app app:app routes
hedron --app app:app components
hedron --app app:app preview home
hedron check --format json --severity error
hedron graph
hedron audit-components
If hedron is not on your PATH, use python -m hedron.
Links
- Documentation
- Optional packages
- What’s ready
- Changelog
- Source
- Issues
hedron-core·hedron-flask·hedron-django
License
MIT. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hedron-0.20.0.tar.gz.
File metadata
- Download URL: hedron-0.20.0.tar.gz
- Upload date:
- Size: 116.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3668ae1a98417abaf5f7139c3fa13594fe1f86d9dff54584de3136538f74da91
|
|
| MD5 |
534cbbd1621936d186d448e2a6ff8ae2
|
|
| BLAKE2b-256 |
d69f7384477eb9dc980fb0e96230c689a9d6a135545b31fd621bd413ffd8646f
|
File details
Details for the file hedron-0.20.0-py3-none-any.whl.
File metadata
- Download URL: hedron-0.20.0-py3-none-any.whl
- Upload date:
- Size: 138.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ace5c63041f204aeaab76f39fabbc419dda16e9d345cb29c47439c4d350b2700
|
|
| MD5 |
3450d154a51cf985e57d7a18247ec23f
|
|
| BLAKE2b-256 |
24e14e2dff879cde95e0239be71a50135a01ef04f6f0985292097d18c0050400
|