skillfed

html5tagger

Pythonic HTML generation/templating (no template files)

html5tagger v2.0.0 1.2M downloads/30d#4,233 on PyPI32
Permissive license Unlicense Active released

What it is and what it does

html5tagger is a pure-Python HTML generation library that lets you build HTML5 documents and snippets using Python method chaining and dot notation instead of writing template files or concatenating strings. You call methods on builder objects to add tags, set attributes, and nest content—for example, `E.p("text").a(href="...")` produces a paragraph with a link. It supports both standalone snippets via the `E` builder and full documents via `Document`, which automatically includes DOCTYPE declarations.

The library includes a templating system that precompiles static content into long strings and leaves only capitalized placeholders for dynamic values, designed to render quickly. It handles HTML5 specifics like optional closing tags, context-aware escaping (different rules for attributes, script content, and iframe srcdoc), and CSS selector syntax for setting classes and IDs. With no external dependencies and support for Python 3.10 through 3.14, it's straightforward to install and integrate into any project.

Use it for:

  • Generate HTML responses in web frameworks where you prefer code over template files.
  • Build reusable page components by composing templates with dynamic data injection.
  • Create HTML emails or reports programmatically with proper escaping and structure.
  • Render complex nested HTML structures (tables, lists, forms) using Python control flow.
  • Prototype or test HTML output without managing separate template files.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates HTML5 markup programmatically using Python syntax instead of templates or string concatenation, with no external dependencies.

Yes. html5tagger is actively maintained, has zero dependencies, supports current Python versions, carries a permissive license, and solves a real problem—generating HTML without template syntax or string manipulation. The low install friction and recent activity make it a safe choice. Install it if you prefer writing HTML in Python code rather than templates.

Install

html5tagger on PyPI

pip

pip install html5tagger

uv

uv add html5tagger

poetry

poetry add html5tagger

Installing html5tagger

Before you install

Installs with no runtime dependencies and low friction. Active maintenance with recent releases; last commit 2026-07-10 and version 2.0.0 released 35 days ago.

License in practice

Licensed under Unlicense (permissive public domain equivalent), imposing no restrictions on use, modification, or distribution.

Quickstart

pip install html5tagger

from html5tagger import Document, E

doc = Document("My Page", lang="en")
doc.h1("Hello").p("Content here")
print(str(doc))

Requires Python 3.10 or later.

Verify before relying

  • Performance comparison with Jinja2 under realistic workloads and document sizes.
  • Whether the 'super fast' claim in the description is independently benchmarked.
  • Real-world adoption patterns and use in production systems beyond the 1.2M monthly downloads.

Package facts

License Unlicense (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 35 days since the last release
Last repo commit
First released
Downloads 1,194,859/month — #4,233 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: html5tagger-2.0.0-py3-none-any.whl

Keywords: HTML, HTML5, Jinja, templating

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseLicense :: Public DomainOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Text Processing :: Markup :: HTML

Tags

python html generationhtml5 builderprogrammatic html markuphtml templating without templatespython html5 syntaxfast html generationhtml5 document builder
html-generationtemplatingno-dependencies

More HTML packages