Skip to main content

hedron

PyPI Python CI License: MIT

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>=0.17.0"
# or
uv add "hedron>=0.17.0"

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. Current train: 0.17.0 (Beta).

Quick start

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")

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

hedron-0.17.0.tar.gz (109.3 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.17.0-py3-none-any.whl (130.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hedron-0.17.0.tar.gz
  • Upload date:
  • Size: 109.3 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.17.0.tar.gz
Algorithm Hash digest
SHA256 fcea5e3330716f5301ebea235bf4471c7f2411ffe6c76be86447b2325f871b70
MD5 75bac5d46e94de3b3ef09a85c21939dd
BLAKE2b-256 19aead33204311a88cbace5fc8572fa1a2183525719641cbbcd4fe3e258f20d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hedron-0.17.0-py3-none-any.whl
  • Upload date:
  • Size: 130.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.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c99162290d8c23cbcaf6f3729b521c08b130be4a9bdc0971074e2c185385e1ce
MD5 6e728f1ee763c980085d381a507e986b
BLAKE2b-256 b01dcbbb54299f7b62077f912da46540d2ab5f21543ab33199e5e0813dfd2226

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