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.3.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.3.0
File Size Uploaded Provenance Actions
hedron_flask-1.3.0.tar.gz 27.7 kB Without provenance Details for hedron_flask-1.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 56.6 kB

Release files / hedron_flask-1.3.0.tar.gz

Download URL hedron_flask-1.3.0.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8341b67a8b506d5f1c001fac9bf41b3ad3733b62ade335d9d35ad51414137f0d
BLAKE2b-256 checksum
How to use checksums
b1fe7c5728dfd3772c830a080ee937b7c17fa3737eab5583870d076509684665
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.3.0-py3-none-any.whl

Download URL hedron_flask-1.3.0-py3-none-any.whl
Size 28.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9aba07d73b4dd73c68912d4c2145aa85a3814040ac2b443791e262d63e3dfada
BLAKE2b-256 checksum
How to use checksums
0d019fc66b0388fcf72920a299235622aa7fc80d150fb7879a61b45f5bb54e41
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.3.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.3.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