Metadata-Version: 2.4
Name: hedron
Version: 0.16.0
Summary: FastAPI-native typed component framework for HTML and HTMX
Project-URL: Homepage, https://github.com/eddiethedean/hedron
Project-URL: Repository, https://github.com/eddiethedean/hedron
Project-URL: Issues, https://github.com/eddiethedean/hedron/issues
Project-URL: Changelog, https://github.com/eddiethedean/hedron/blob/main/packages/hedron/CHANGELOG.md
Project-URL: Documentation, https://hedron.readthedocs.io/en/latest/
Author-email: Odos Matthews <odosmatthews@gmail.com>
Maintainer-email: Odos Matthews <odosmatthews@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: components,fastapi,html,htmx,server-rendered,typed
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: <3.15,>=3.11
Requires-Dist: fastapi<0.150,>=0.141.1
Requires-Dist: hedron-core<0.17,>=0.16.0
Requires-Dist: itsdangerous>=2.2
Requires-Dist: packaging>=24.0
Requires-Dist: pydantic<2.15,>=2.13.4
Requires-Dist: python-multipart>=0.0.9
Provides-Extra: auth
Requires-Dist: authlib>=1.3; extra == 'auth'
Requires-Dist: httpx>=0.28; extra == 'auth'
Provides-Extra: browser
Requires-Dist: playwright>=1.40; extra == 'browser'
Provides-Extra: charts
Requires-Dist: hedron-charts<0.2,>=0.1.0; extra == 'charts'
Provides-Extra: code
Requires-Dist: pygments>=2.17; extra == 'code'
Provides-Extra: conformance
Requires-Dist: hedron-conformance<0.17,>=0.16.0; extra == 'conformance'
Provides-Extra: data
Requires-Dist: hedron-data<0.17,>=0.16.0; extra == 'data'
Provides-Extra: dev
Requires-Dist: hedron-explorer<0.17,>=0.16.0; extra == 'dev'
Provides-Extra: email
Requires-Dist: email-validator>=2.0; extra == 'email'
Provides-Extra: extras
Requires-Dist: hedron-extras<0.17,>=0.16.0; extra == 'extras'
Provides-Extra: images
Requires-Dist: pillow>=10.0; extra == 'images'
Provides-Extra: jinja
Requires-Dist: hedron-jinja<0.17,>=0.16.0; extra == 'jinja'
Provides-Extra: markdown
Requires-Dist: markdown>=3.5; extra == 'markdown'
Requires-Dist: nh3>=0.2; extra == 'markdown'
Provides-Extra: native
Requires-Dist: hedron-native<0.2,>=0.1.0; extra == 'native'
Provides-Extra: otel
Requires-Dist: opentelemetry-api<2,>=1.27; extra == 'otel'
Provides-Extra: sanitize
Requires-Dist: nh3>=0.2; extra == 'sanitize'
Description-Content-Type: text/markdown

# hedron

[![PyPI](https://img.shields.io/pypi/v/hedron.svg)](https://pypi.org/project/hedron/)
[![Python](https://img.shields.io/pypi/pyversions/hedron.svg)](https://pypi.org/project/hedron/)
[![CI](https://img.shields.io/github/actions/workflow/status/eddiethedean/hedron/ci.yml?branch=main&label=CI)](https://github.com/eddiethedean/hedron/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/eddiethedean/hedron/blob/main/LICENSE)

FastAPI-native typed component framework for HTML and HTMX.

Builds on framework-neutral [`hedron-core`](https://pypi.org/project/hedron-core/)
with pages, addressable components, typed actions, CSRF-aware forms, OpenAPI
`text/html` metadata, interaction built-ins (`Lazy`, `Poll`, `Pagination`, …),
caching (`cache_data` / `cache_component`), utility UI, ColorMode persistence,
a thin `Hedron()` application facade, CLI (`new`/`check`/`graph`/`build`/…),
plugin loader, and public `hedron.testing` helpers.

## Install

```bash
pip install "hedron>=0.16.0"
# or
uv add "hedron>=0.16.0"
```

Optional data and charts:

```bash
pip install "hedron[data]"
pip install "hedron[charts]"
```

Development Explorer:

```bash
pip install "hedron[dev]"
```

Optional browser testing extras:

```bash
pip install "hedron[browser]"
```

Requires Python 3.11, 3.12, 3.13, or 3.14. Current train: **0.16.0** (Beta).

## Quick start

```python
from hedron import Hedron, Page, Text

app = Hedron(
    title="Demo",
    security="standard",
    session_secret="replace-in-production",
    explorer="off",
)


@app.page("/")
def home() -> Page:
    return Page(Text("Hello, Hedron"), title="Demo")
```

Plain FastAPI without the `Hedron` subclass:

```python
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):

```bash
hedron new demoapp
cd demoapp
hedron --app app:app routes
hedron --app app:app components
hedron --app app:app preview home
hedron check --format json --severity error
hedron graph
hedron audit-components
```

## Links

- [Documentation](https://hedron.readthedocs.io/en/latest/)
- [Changelog](https://github.com/eddiethedean/hedron/blob/main/packages/hedron/CHANGELOG.md)
- [Source](https://github.com/eddiethedean/hedron)
- [`hedron-core`](https://pypi.org/project/hedron-core/) · [`hedron-explorer`](https://pypi.org/project/hedron-explorer/) · [`hedron-sample-kit`](https://pypi.org/project/hedron-sample-kit/)

## License

MIT. See [LICENSE](LICENSE).
