hedron
FastAPI-native typed component framework for HTML and HTMX.
Builds on framework-neutral hedron-core
with pages, addressable components, typed actions, CSRF-aware forms, OpenAPI
text/html metadata, interaction built-ins (Lazy, Poll, Pagination, …),
caching (cache_data / cache_component), utility UI, ColorMode persistence,
a thin Hedron() application facade, CLI (new/check/graph/build/…),
plugin loader, and public hedron.testing helpers.
Install
pip install hedron
# or
uv add hedron
Optional data and charts:
pip install "hedron[data]"
pip install "hedron[charts]"
Development Explorer:
pip install "hedron[dev]"
Optional browser testing extras:
pip install "hedron[browser]"
Requires Python 3.11, 3.12, 3.13, or 3.14.
Quick start
from hedron import Hedron, Page, Text
app = Hedron(
title="Demo",
security="standard",
session_secret="replace-me",
explorer="off",
)
@app.page("/")
def home() -> Page:
return Page(Text("Hello, Hedron"), title="Demo")
Plain FastAPI without the Hedron subclass:
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 inspection (optionally load an app module first):
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
Links
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.8.0.tar.gz.
File metadata
- Download URL: hedron-0.8.0.tar.gz
- Upload date:
- Size: 68.7 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 |
57df989bd82e812e768eb34a96d05ac0b6bc7d3f4a16641d16438e09eded5ae2
|
|
| MD5 |
ecf6a36b30ffb8dbb2d91fca21ab5e39
|
|
| BLAKE2b-256 |
a917e75d73e2902643ad599b6d990e0f3cc422953f9404b962683089834875c4
|
File details
Details for the file hedron-0.8.0-py3-none-any.whl.
File metadata
- Download URL: hedron-0.8.0-py3-none-any.whl
- Upload date:
- Size: 81.1 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 |
fb01a6d95be33a1a2388b7dffcfa64410794e7900ebbfdc928c4221c1cfcf975
|
|
| MD5 |
6ac44053b60aed7c29708d3fde634fcc
|
|
| BLAKE2b-256 |
9149cfabfa37ee7349734d03f7f627bf7e4243dd039adfbfd9938759fc032352
|