An agile, powerful Python framework for creating dynamic UIs with seamless web integration.
Project description
Trunco
Trunco is a Python framework for building dynamic, reusable HTML components. It integrates with Django, Flask, FastAPI, and other web frameworks, with optional DaisyUI and 0build (formerly Franken UI) kits.
Features
- Component-based architecture — composable Python objects render to HTML
- Optional integrations — Alpine.js, HTMX, UIKit helpers built in
- UI kits —
trunco.daisyandtrunco.zbuildwith unified short imports (Form,Button,Alert, …) - Custom themes — register your own color schemes like DaisyUI/Tailwind
- Zero runtime dependencies — core install is dependency-free
Installation
uv pip install trunco
Quickstart
from trunco.daisy import Form, FormControl, Input, Button, Alert, Page
form = Form(action="/save")
form.add_child(FormControl(label="Email", field=Input(placeholder="you@example.com")))
form.add_child(Button(label="Save", color="primary"))
form.add_child(Alert(message="Ready", color="info"))
print(Page(form, theme_name="light").render())
Swap kits by changing one import:
import trunco.daisy as ui # or: import trunco.zbuild as ui
Documentation
The docs site is built with Trunco and deployed to GitHub Pages.
uv pip install -e .
uv run python docs/serve.py # preview at http://127.0.0.1:8000
uv run python docs/build.py # build only → docs/_site/
| Resource | Location |
|---|---|
| Live docs | GitHub Pages (after deploy) |
| Site source | docs/src/ |
| Build script | docs/build.py |
| Legacy markdown | docs/archive/ |
Examples
Runnable examples in examples/:
uv run python examples/01_core_basics.py
uv run python examples/04_daisy_kit.py
uv run python examples/07_kit_swap.py
Development
uv sync
uv pip install -e .
uv run pytest
uv run python docs/build.py
License
MIT — see LICENSE.
Project details
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 trunco-1.0.0.tar.gz.
File metadata
- Download URL: trunco-1.0.0.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f90fc9b7dc4630047abfc7df9c2d76ab2020153e1dc2ab466d3f3213262a5fb2
|
|
| MD5 |
4e3b2848b1dae2ddcf6fecc712f3ad09
|
|
| BLAKE2b-256 |
243cd7fe376742c2138e3160481c4fc4adf73006c9dfe3c868d00cdc5121dbb4
|
Provenance
The following attestation bundles were made for trunco-1.0.0.tar.gz:
Publisher:
publish-pypi.yml on tavallaie/trunco
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trunco-1.0.0.tar.gz -
Subject digest:
f90fc9b7dc4630047abfc7df9c2d76ab2020153e1dc2ab466d3f3213262a5fb2 - Sigstore transparency entry: 1842089974
- Sigstore integration time:
-
Permalink:
tavallaie/trunco@61181f663de446049f234cc16e8080080ef13b96 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/tavallaie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@61181f663de446049f234cc16e8080080ef13b96 -
Trigger Event:
push
-
Statement type:
File details
Details for the file trunco-1.0.0-py3-none-any.whl.
File metadata
- Download URL: trunco-1.0.0-py3-none-any.whl
- Upload date:
- Size: 49.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fda4a1e23ad3fe1af964a76ac2278e235874f94b666d8beba9a05bd6a2e1c39
|
|
| MD5 |
602f591790dcd834eea61623cb94a6ec
|
|
| BLAKE2b-256 |
58a56482d753e6cd1bd5aea6fc03ed505c6bface99368d63cae6d0a555549d64
|
Provenance
The following attestation bundles were made for trunco-1.0.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on tavallaie/trunco
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trunco-1.0.0-py3-none-any.whl -
Subject digest:
9fda4a1e23ad3fe1af964a76ac2278e235874f94b666d8beba9a05bd6a2e1c39 - Sigstore transparency entry: 1842090089
- Sigstore integration time:
-
Permalink:
tavallaie/trunco@61181f663de446049f234cc16e8080080ef13b96 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/tavallaie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@61181f663de446049f234cc16e8080080ef13b96 -
Trigger Event:
push
-
Statement type: