Skip to main content

hedron

FastAPI-native typed component framework for HTML and HTMX (0.2.0).

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, …), and a thin Hedron() application facade.

Install

pip install hedron
# or
uv add hedron

Development Explorer preview:

pip install "hedron[dev]"

Requires Python 3.11, 3.12, 3.13, or 3.14.

Quick start

from hedron import Hedron, Page, Text

app = Hedron(
    title="Demo",
    security="standard",
    session_secret="replace-me",
    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 --app myapp:app routes
hedron --app myapp:app components
hedron --app myapp:app preview home

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.2.0.tar.gz (36.7 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.2.0-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hedron-0.2.0.tar.gz
  • Upload date:
  • Size: 36.7 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.2.0.tar.gz
Algorithm Hash digest
SHA256 58fc9cae96156578b5d52f7463db3d8d92584385736c299f7595ef89f78b43d0
MD5 6c5dbde0fe4765371848433aefc7d7f9
BLAKE2b-256 ee76d02720cb191523c4860987d65aaa0905bbf11a9d9ab9a4e76d2579df1939

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hedron-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 44.1 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73a4d8fe4a1f02fd5ee59c7d67f28818986b59901869142b9bc18c90730e35d5
MD5 6fc7384673db8ca707d7c81055e55cf2
BLAKE2b-256 c5d276f3c60a1b053676604fff824c1773866bce55c5a00fd34310ba6ca61845

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