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.23.0 (Published) · pin >=0.23.0,<0.24

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.23.0,<0.24"
# or
uv add "hedron>=0.23.0,<0.24"

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.23.0,<0.24"
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.23.0,<0.24" 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.23.0,<0.24" "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.23.0.tar.gz (119.6 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.23.0-py3-none-any.whl (141.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for hedron-0.23.0.tar.gz
Algorithm Hash digest
SHA256 09e330ea5c62e42f194aa9d0f38b35825c9bd4a19b7516f646204dcd1a8288be
MD5 f530277ec07ff0fd0b68a28f0c0206d7
BLAKE2b-256 a4529c706714f68009f50bd2ec6a5a1f5b4fc5dcf8d7cfe70b82107a1c52879b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hedron-0.23.0-py3-none-any.whl
  • Upload date:
  • Size: 141.4 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.23.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d496978ce80e2256ef5d4b04311b5edbd7c0db467f6a151d0554b53c24ae0542
MD5 88e59d6c265277d3f2d1df5309a9be8e
BLAKE2b-256 8e5b7bcc128f5bc6db645ef4fa69f9586638df9984396da361c1e54a2a26a7c4

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