PyJinHx¶
Build reusable, type-safe UI components for template-based web apps in Python.
PyJinHx combines Pydantic models with Jinja2 templates to give you template discovery, component composition, and asset bundling.
Features¶
- Automatic Template Discovery - Place templates next to component files, no manual paths needed
- Composability - Nest components easily with single components, lists, and dictionaries
- Asset Bundling - Automatically collects and bundles
.jsand.cssfiles from component directories - Type Safety - Pydantic models provide validation and IDE support
Choose your depth¶
PyJinHx layers optional features on top of a small core. You can stop at any tier:
| Tier | You get | Start here |
|---|---|---|
| 1 — Components | BaseComponent, templates, assets |
Quick Start |
| 2 — Web app | Per-request Registry.request_scope() |
Registry guide |
| 3 — Reactive | HTMX OOB swaps, @mutates, load() |
Reactivity |
| 4 — Full wiring | PjxContext, ClientBackend, cache, invalidation |
Build an App |
Details: Usage tiers.
Two Ways to Render¶
Within Tier 1, PyJinHx offers two complementary approaches:
Instantiate components in Python and call .render():
Next Steps¶
- Installation - Install PyJinHx
- Build an App - Step-by-step tutorial with Why? panels (recommended for new users)
- Quick Start - Minimal first component
- Guide - Feature reference
- Built-in UI components - Optional
pyjinhx.builtinspackage - Public API Index - Every symbol exported from
pyjinhx - Migration guide — 0.8 → 0.9 breaking changes and upgrading from 0.4.x