Skip to main content

concise html tag generation

Project description

html-tags

PyPI version

[!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.12.tar.gz (5.9 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.12-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: html_tags-0.0.12.tar.gz
  • Upload date:
  • Size: 5.9 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.12.tar.gz
Algorithm Hash digest
SHA256 caf5e287e6113c8fd569bf665e233bbc56fce2106b76cbc5fa27f4451d3c52e7
MD5 d4966b50c7bfb2c72e6630941225560e
BLAKE2b-256 e4dbe999ee178cb53618121e066fb40c96249663209c4f69cee0c18dd59c5270

See more details on using hashes here.

File details

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

File metadata

  • Download URL: html_tags-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 7.2 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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 1b2fa167b73a7eb4e8ff4f05b6873cc3fc9c11be38a15fab4f7205f8c279885d
MD5 c37b79db3112d108d274125ad9de8197
BLAKE2b-256 63202bf4c22e52a6f8fb396173174acc55352eba29067a8a6d1480aa6a9bf2e7

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