htmlBuilder
A beautiful html builder library.
Decision gist · record as of 2026-08-14
Yes, if you prefer writing Python code over learning a template language and don't need active maintenance. The library is stable, has no dependencies, and carries a permissive license. However, note that the last release was in 2021; if you encounter bugs or need new features, community support may be limited. It is suitable for projects where HTML generation is straightforward and you value code clarity over template-engine maturity.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with no runtime dependencies.
- Maintenance is dormant—last release was 2021-03-02, over 1991 days ago, though the repository remains active and unarchived.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license and copyright notice.
last release 2021-03-02 (1991 days) · last repo commit 2024-03-25 · 38 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 91,710 downloads/mo, #13,506 on PyPI
Alternatives
Verify before relying
pip install htmlbuilder
from htmlBuilder.tags import Html, Head, Title, Body, Div
from htmlBuilder.attributes import Class
html = Html([], Head([], Title([], "My Page")), Body([Class('main')], Div([], "Hello")))
print(html.render(pretty=True))- Whether the package handles modern HTML5 features and attributes beyond the examples shown.
- Performance characteristics when rendering large or deeply nested HTML structures.
- Whether attribute escaping and XSS prevention are built in or require manual handling.
What it is and what it does
htmlBuilder lets you construct HTML documents by writing Python code instead of templates or markup strings. Each HTML tag is a Python class that accepts child elements and attributes as constructor arguments, and you call render() to produce the final HTML string. This approach lets you use Python's full feature set—loops, comprehensions, conditionals, functions—directly in your HTML generation logic, without learning a separate template syntax.
The library is designed around three core ideas: minimal learning curve (you need only Python and HTML knowledge), real Python code (the generation logic reads like normal Python), and testability (you can inspect and unit-test the tag object structure before rendering). It has no runtime dependencies, supports Python 3.6 and later, and carries an MIT license.
Use it for
- Generate dynamic HTML pages from Python data structures (e.g., rendering user lists or product catalogs).
- Build HTML in unit tests without external template files or string concatenation.
- Create reusable HTML components as Python functions that return tag objects.
- Programmatically construct email templates or reports where Python logic drives the structure.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you prefer writing Python code over learning a template language and don't need active maintenance.
The library is stable, has no dependencies, and carries a permissive license. However, note that the last release was in 2021; if you encounter bugs or need new features, community support may be limited. It is suitable for projects where HTML generation is straightforward and you value code clarity over template-engine maturity.
Install
htmlbuilder on PyPI
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2021-03-02, over 1991 days ago, though the repository remains active and unarchived.
License in practice
MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license and copyright notice.
Quickstart
pip install htmlbuilder
from htmlBuilder.tags import Html, Head, Title, Body, Div
from htmlBuilder.attributes import Class
html = Html([], Head([], Title([], "My Page")), Body([Class('main')], Div([], "Hello")))
print(html.render(pretty=True))
Verify before relying
- Whether the package handles modern HTML5 features and attributes beyond the examples shown.
- Performance characteristics when rendering large or deeply nested HTML structures.
- Whether attribute escaping and XSS prevention are built in or require manual handling.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 1,991 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 91,710 / month, #13,506 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: Markup :: HTML |
Evidence: htmlBuilder-1.0.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “programmatic html rendering”
- htmlBuilderRender HTML by writing Python code, using classes to represent tags…
- yattagYattag generates HTML or XML documents using Python code with context…
- django-crispy-formsRenders Django forms programmatically with full HTML control using…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also html5tagger · htmltools · dominate · htbuilder · branca · tinyhtml · hyperscript · meld3 · Mako · htpy