Skip to main content

hedron-flask

PyPI Python CI License: MIT

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 · Package line: 1.0.x · pin >=1.0.0,<2.0

Adapter capability readiness is Supported when pinned — see What’s ready.

Install

pip install "hedron-flask>=1.0.0,<2.0"
# or
uv add "hedron-flask>=1.0.0,<2.0"

Requires Python 3.11–3.14, hedron-core, and Flask 3.x.

Scaffold a new Flask app:

uvx --from "hedron>=1.0.0" 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_app application integration
  • HedronBlueprint with @page / @view / @action style routing
  • component_response / interaction_response helpers
  • Fragment region authorization and approved HTMX header merging
  • Portable SecurityPolicy headers and Flask-Login AuthSignal bridge
  • Job status polling helpers (poll_status_response)

License

MIT. See the repository license.

Metadata

Release files for hedron-flask 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hedron-flask 1.2.0
File Size Uploaded Provenance Actions
hedron_flask-1.2.0.tar.gz 27.7 kB Without provenance Details for hedron_flask-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hedron-flask 1.2.0
File Interpreter ABI Platform Actions
hedron_flask-1.2.0-py3-none-any.whl Python 3 none any Details for hedron_flask-1.2.0-py3-none-any.whl

Total release size: 56.6 kB

Release files / hedron_flask-1.2.0.tar.gz

Download URL hedron_flask-1.2.0.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a2d4c6eb04767b73a2dba8c3f73e718c45183c2f80bd492f6ff1efcca69a9e8e
BLAKE2b-256 checksum
How to use checksums
04eb65fdaa970e67438a139af31236d3a1c60ecec5a797bc7f2a7f981e1b289a
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-1.2.0-py3-none-any.whl

Download URL hedron_flask-1.2.0-py3-none-any.whl
Size 28.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1700add648c99799bc944303945906f7f7bb3948208a8a61039bfe4c28b74a5
BLAKE2b-256 checksum
How to use checksums
b6a74183b23ffe19a3472f05a312258f9f016cee0f3a57a14a84e3f9f7a4e766
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}

Security for hedron-flask 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page