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.25.0 (Published) · pin >=0.25.0,<0.26

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.25.0,<0.26"
# or
uv add "hedron>=0.25.0,<0.26"

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.25.0,<0.26"
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.25.0,<0.26" 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.25.0,<0.26" "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.25.0.tar.gz (120.4 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.25.0-py3-none-any.whl (141.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hedron-0.25.0.tar.gz
  • Upload date:
  • Size: 120.4 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.25.0.tar.gz
Algorithm Hash digest
SHA256 6cd06ef4fdba8224b0053088e4548de0c716a8bbb030a41175e6acbbc017ebf8
MD5 2a43b6856e9620117b826713a83135f5
BLAKE2b-256 df389a1b56a40205c811a3be8320ff38df692852bea0a8ac39f89c5242af830d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hedron-0.25.0-py3-none-any.whl
  • Upload date:
  • Size: 141.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.25.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92bc77b1a01570b9ce19a80f06b0318beb812b38265fdc8eaabe4aa706e4e2de
MD5 b82584a87873f18203b76985472dc042
BLAKE2b-256 96c3a975f35c70e90d0097c314d73d518751c85115a8d4c71b71dd6c48edc2b1

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