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.21.0 (Published) · pin >=0.21.0,<0.22
Adapter capability readiness is Supported when pinned — see What’s ready.
Install
pip install "hedron-flask>=0.21.0,<0.22"
# or
uv add "hedron-flask>=0.21.0,<0.22"
Requires Python 3.11–3.14, hedron-core, and Flask 3.x.
Scaffold a new Flask app:
uvx --from "hedron>=0.21.0,<0.22" 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 LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hedron_flask-0.21.0.tar.gz.
File metadata
- Download URL: hedron_flask-0.21.0.tar.gz
- Upload date:
- Size: 13.1 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53887a725a532078ac07e7f55a818a368cba8b63da112aa3f92179010c1e5680
|
|
| MD5 |
609b99b3f5f7b5b8968c172024dd0995
|
|
| BLAKE2b-256 |
899bd216454e835cb3d7e8e2f5e6248d1902552975969a7ca17c8acf311fe377
|
File details
Details for the file hedron_flask-0.21.0-py3-none-any.whl.
File metadata
- Download URL: hedron_flask-0.21.0-py3-none-any.whl
- Upload date:
- Size: 16.5 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
581fe0e6e28641490ed41fc8f33faeb3a94dee476c388e76d9eef2114e2d78e3
|
|
| MD5 |
c7b693b28164740108d5af13ea692b3e
|
|
| BLAKE2b-256 |
7e8be3af38fbf0cf91c9379c11011f1e6caf1c3c3c1a9148d44250dffd754d99
|