Skip to main content

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 kitstrunco.daisy and trunco.zbuild with 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

trunco-1.0.0.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trunco-1.0.0-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

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

Hashes for trunco-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f90fc9b7dc4630047abfc7df9c2d76ab2020153e1dc2ab466d3f3213262a5fb2
MD5 4e3b2848b1dae2ddcf6fecc712f3ad09
BLAKE2b-256 243cd7fe376742c2138e3160481c4fc4adf73006c9dfe3c868d00cdc5121dbb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for trunco-1.0.0.tar.gz:

Publisher: publish-pypi.yml on tavallaie/trunco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for trunco-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fda4a1e23ad3fe1af964a76ac2278e235874f94b666d8beba9a05bd6a2e1c39
MD5 602f591790dcd834eea61623cb94a6ec
BLAKE2b-256 58a56482d753e6cd1bd5aea6fc03ed505c6bface99368d63cae6d0a555549d64

See more details on using hashes here.

Provenance

The following attestation bundles were made for trunco-1.0.0-py3-none-any.whl:

Publisher: publish-pypi.yml on tavallaie/trunco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page