Skip to main content

concise html tag generation

Project description

html-tags

[!WARNING] This project is under active development - Mar 2026

Concise HTML generation for Python.

from html_tags import setup_tags
setup_tags()

page = Html(
    Head(Title("hello")),
    Body(
        H1("hello world", cls="title"),
        Button({"data-on:click": "@delete('/1')"})("delete"),
    )
)

Tags are immutable and composable — call a tag to add children or attributes:

Div(cls="card")("some content", id="main")

Datastar SSE helpers included:

from html_tags import patch_elements, patch_signals, datastar_stream

Install

pip install html-tags
uv add html-tags

License

MIT

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

html_tags-0.0.8.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

html_tags-0.0.8-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file html_tags-0.0.8.tar.gz.

File metadata

  • Download URL: html_tags-0.0.8.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","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 html_tags-0.0.8.tar.gz
Algorithm Hash digest
SHA256 2e8f12b5f11dca681dc0c1d9b2deaee67f5a052761b29659537e4f6acb80b382
MD5 8838f570a31d3aed17a547787484b27f
BLAKE2b-256 ec0432505a1335dfc22a01bca0319576a35e7967e33a8dc4321daf899cbeb6a4

See more details on using hashes here.

File details

Details for the file html_tags-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: html_tags-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","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 html_tags-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 97842fc8e0a39e36917bc220efdaf3a60fe099915520cc5bcc4650df4ce554fa
MD5 1aa00a837bbd1b9c1c142a29385cdcd2
BLAKE2b-256 db8500090f8ad65c71ed48cd30def7b1093fb9d65273718dc332a3c36c1dee0f

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