Skip to main content

hedron

PyPI Python CI License: MIT

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.21.0 (Published) · pin >=0.21.0,<0.22

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.21.0,<0.22"
# or
uv add "hedron>=0.21.0,<0.22"

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.21.0,<0.22"
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.21.0,<0.22" 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.21.0,<0.22" "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

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

hedron-0.21.0.tar.gz (116.9 kB view details)

Uploaded Source

Built Distribution

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

hedron-0.21.0-py3-none-any.whl (138.8 kB view details)

Uploaded Python 3

File details

Details for the file hedron-0.21.0.tar.gz.

File metadata

  • Download URL: hedron-0.21.0.tar.gz
  • Upload date:
  • Size: 116.9 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

Hashes for hedron-0.21.0.tar.gz
Algorithm Hash digest
SHA256 230fd0dfeddd9fd91305c4be3d3698ca0641f9108a90f9479940c255a3e2f2d5
MD5 b3a39b7cde64597198c7538bd4542439
BLAKE2b-256 854abcc8dea6ec746e7e170eabe7547df7b1465801184a5e7613eaa7bdecd770

See more details on using hashes here.

File details

Details for the file hedron-0.21.0-py3-none-any.whl.

File metadata

  • Download URL: hedron-0.21.0-py3-none-any.whl
  • Upload date:
  • Size: 138.8 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

Hashes for hedron-0.21.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0cac26d5a39fef21d9546821856424da10bfa7f69f30b0aa27688e73ce876cfb
MD5 2bc3507d12418fbf7b6de8fa3d48f6d7
BLAKE2b-256 dd7964f653353553d4089fc202e278c3a6c81d3623ae6fd6c98af191cc8919c7

See more details on using hashes here.

Supported by

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