hedron-flask
Flask adapter for Hedron component rendering and HTMX interactions.
Render Page / fragment components with the same hedron-core
renderer used by FastAPI, map portable InteractionResult values to native Flask
responses, and integrate CSRF double-submit cookies with Flask sessions. Does not
install FastAPI.
Package maturity: Beta · Train: 0.55.x (in-tree tip v0.55.0; PyPI 0.54.0 deferred) · pin >=0.55.0,<0.56 in-tree (PyPI >=0.54.0,<0.55 while deferred)
Adapter capability readiness is Supported when pinned — see What’s ready.
Install
pip install "hedron-flask>=0.55.0,<0.56"
# or
uv add "hedron-flask>=0.55.0,<0.56"
Requires Python 3.11–3.14, hedron-core, and Flask 3.x.
Scaffold a new Flask app:
uvx --from "hedron>=0.54.0,<0.55" hedron new --flask my-flask-app
Quick start
from flask import Flask
from hedron_core import Heading, Page, Text
from hedron_core.interaction import FragmentRegion, InteractionResult
from hedron_flask import HedronBlueprint, HedronFlask
hedron = HedronFlask()
ui = HedronBlueprint("ui", __name__)
PANEL = FragmentRegion(id="panel", selector="#panel")
@ui.page("/")
def home():
return Page(
Heading("Hello Flask", level=1),
Text("Native Flask routing with Hedron components."),
title="Home",
)
@ui.component("/fragment", fragment_regions=(PANEL,))
def fragment():
return InteractionResult(content=Text("Fragment ok"), explanation="demo")
def create_app() -> Flask:
app = Flask(__name__)
app.secret_key = "replace-in-production"
hedron.init_app(app)
app.register_blueprint(ui)
return app
flask --app app:create_app run --reload
What this package includes
HedronFlask/init_appapplication integrationHedronBlueprintwith@page/@component/@actionstyle routingcomponent_response/interaction_responsehelpers- Fragment region authorization and approved HTMX header merging
- Portable
SecurityPolicyheaders and Flask-LoginAuthSignalbridge - Job status polling helpers (
poll_status_response)
Links
- Add to an existing Flask app
- Adapters API
- Changelog
- Source
- Issues
- Flask reference example
hedron-core·hedron·hedron-django
License
MIT. See the repository license.
Release files for hedron-flask 0.55.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hedron_flask-0.55.0.tar.gz | 24.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hedron_flask-0.55.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.9 kB
Release files / hedron_flask-0.55.0.tar.gz
| Download URL | hedron_flask-0.55.0.tar.gz |
|---|---|
| Size | 24.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd862d09e4b3d58eecec0b37a53468da210200be6d99538c1b944ef4c249e48f
|
|
BLAKE2b-256 checksum How to use checksums |
5b36359d2cce72795d0f7e68089260914a62bb34028b5eea046bbe73cd5f18a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / hedron_flask-0.55.0-py3-none-any.whl
| Download URL | hedron_flask-0.55.0-py3-none-any.whl |
|---|---|
| Size | 25.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b56f6a441357c5275f18a1f83dabb9480a7f75e3ba407f2ec6204d832cc28d57
|
|
BLAKE2b-256 checksum How to use checksums |
5fb9d47e3b40455a3ec7d65d7bf99e3506b4d5474f6ff36291c3a35c69846e5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|