--- id: html5tagger version: "2.0.0" license: Unlicense license_treatment: permissive maintenance: active --- # html5tagger — Pythonic HTML generation/templating (no template files) License: permissive · Maintenance: active · Downloads: 1.2M/mo ## 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 above — 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 pip install html5tagger uv add html5tagger 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_current - Install friction: low - Maintenance: active - Downloads: 1.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags python html generation, html5 builder, programmatic html markup, html templating without templates, python html5 syntax, fast html generation, html5 document builder, html-generation, templating, no-dependencies [View on SkillFed](https://skillfed.io/packages/html5tagger) · [View on PyPI](https://pypi.org/project/html5tagger/)