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.22.0 (Published) · pin >=0.22.0,<0.23

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.22.0,<0.23"
# or
uv add "hedron>=0.22.0,<0.23"

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.22.0,<0.23"
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.22.0,<0.23" 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.22.0,<0.23" "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.22.0.tar.gz (118.2 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.22.0-py3-none-any.whl (140.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hedron-0.22.0.tar.gz
  • Upload date:
  • Size: 118.2 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.22.0.tar.gz
Algorithm Hash digest
SHA256 ef7641aa5090526a08bd01c81e0e2edb2cc15710a2fafc574ccb8a0d26d23072
MD5 3e6e38fab83f8e26cc07dcde302f814a
BLAKE2b-256 e747ea71448446c75c458531db9692882d792c9c12d465ed0be716e23fbd1574

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hedron-0.22.0-py3-none-any.whl
  • Upload date:
  • Size: 140.0 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.22.0-py3-none-any.whl
Algorithm Hash digest
SHA256 068dc891731013bb968a734721f44cee32a6af43aab60459f5852c13dfce0d0f
MD5 fb25ef254fdbd85f300f57e3cebefbfd
BLAKE2b-256 bde41307b99ba4611757b531a0e36027632fea6633a82ab3716d3bbc5cf8ab0e

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