Skip to main content

Add your description here

Project description

🍃 HTeaLeaf

HTeaLeaf is a declarative web framework for Python — it lets you build dynamic, reactive web apps using pure Python, without writing templates or frontend JavaScript manually.


✨ Overview

HTeaLeaf merges ideas from modern frontend frameworks like React, Svelte, and SolidJS with the simplicity of traditional Python web servers.

You declare HTML directly in Python, manage reactive state via Store objects, and HTeaLeaf takes care of keeping everything in sync — automatically.


🚀 Quick Example

from HTeaLeaf.Server.WSGI import WSGI
from HTeaLeaf.Magic.Store import Store, SuperStore
from HTeaLeaf.Html.Elements import div, h3, button

# Create the server
app = WSGI()
SuperStore(app)

# Reactive server-side store
counter = Store({"count": 0})

@app.route("/")
def home():
    return div(
        button("-").attr(onclick=counter.do.update("count", -1)),
        h3(counter.react("count")),
        button("+").attr(onclick=counter.do.update("count", 1)),
    )

application = app.wsgi_app

if __name__ == "__main__":
    from wsgiref.simple_server import make_server
    with make_server("", 8000, application) as server:
        print("Serving at http://127.0.0.1:8000")
        server.serve_forever()

Open your browser and visit http://127.0.0.1:8000 — you’ll see a fully reactive counter built with only Python

Key Features

  • Declarative HTML components — build DOM structures with Python functions
  • Path-based routing — simple, expressive route definitions
  • Reactive server state (Store, AuthStore) — auto-sync between backend and UI
  • JS transpilation (JSCode, JSDO) — write JavaScript logic directly in Python
  • Session support — cookies and per-user AuthStore state

Roadmap

  • Declarative HTML components
  • Path mapping
  • Server Side State (Stores)
  • JS transcription from python
  • Client Side state
  • State hooks
  • Template system
  • Persistent Store (redis,SQL...)
  • CLI
  • Render optimisation

Documentation

Full documentation is available in the Wiki

Status

HTeaLeaf is currently in alpha. It’s stable enough for experimentation and small demos, but the public API might still change before beta.

License

MIT License © 2025 — HTeaLeaf Framework Made with 🍃 and Python.

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

htealeaf-0.2.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

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

htealeaf-0.2.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file htealeaf-0.2.0.tar.gz.

File metadata

  • Download URL: htealeaf-0.2.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for htealeaf-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2f0cafab180edebe060dd8804a65611a18be157d5af4acd549b1f483339a34fc
MD5 6466b61603dd469488803810bc040c1d
BLAKE2b-256 f9339e8f75ff3c675c75bdbe056dfc7e3ea0fed1c519bad0b80325feb218b285

See more details on using hashes here.

File details

Details for the file htealeaf-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: htealeaf-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for htealeaf-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 566a03a336e3d55e897cca090c485feae61e4927b574e4fdd86583a3f3ab052b
MD5 bcebc3e718b206ce71c9cdfe24396b21
BLAKE2b-256 b6cb4f14d73143e3745140115f51659ba38c30cc6974eb31e3bd685c9938744b

See more details on using hashes here.

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