$npx skillfedfor your agent

htbuilder

A purely-functional HTML builder for Python. Think JSX rather than templates.

With conditionsPyPI HTMLReleased Jan 2025251.1K downloads / moApache 2Source build

Decision gist · record as of 2026-08-14

sdist only — htbuilder-0.9.0.tar.gz · builds from source
v0.9.0 · released 2025-01-09 · Python >=3.7

Yes, if you prefer writing HTML in Python and don't need frequent updates. The package is stable, has no security vulnerabilities, and solves a real problem for developers who dislike template syntax. The dormant maintenance and source-only distribution are minor friction, but the zero runtime dependencies and permissive license make it low-risk for projects that can tolerate infrequent upstream changes.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.7 or later.
  • Installation friction is high—the package ships as a source distribution only.
  • Maintenance is dormant: the last commit was 2025-01-09, but the prior release cycle was 582 days earlier, suggesting infrequent updates.

License · maintenance · safety

Apache 2 (permissive) — Licensed under Apache 2 (permissive), which allows commercial and private use with minimal restrictions. No notable licensing constraints for most use cases.

last release 2025-01-09 (582 days) · last repo commit 2025-01-09 · 104 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 251,139 downloads/mo, #8,595 on PyPI

Verify before relying

pip install htbuilder

from htbuilder import div, ul, li

dom = div(id='container')[
  ul(_class='items')[
    li('item 1'),
    li('item 2'),
  ]
]

print(dom)
  • Whether high install friction (source-only distribution) impacts real-world adoption or if wheels are available through alternative channels.
  • Performance characteristics when building large or deeply nested HTML structures.
  • Whether dormant maintenance status affects compatibility with newer Python versions beyond 3.7.
Same gist for agents: .md · .json

What it is and what it does

htbuilder is a lightweight HTML string generator that replaces template languages with pure Python function calls. Instead of writing HTML templates or concatenating strings, you import tag names (div, span, ul, etc.) as functions and call them with content and attributes as arguments. The package supports multiple syntaxes—positional arguments, keyword arguments, chained calls with parentheses, or bracket notation—so you can choose the style that reads most naturally to you.

The core value is that HTML generation becomes just Python: you can use loops, conditionals, and variables directly in your markup without template syntax. It also provides helper functions for common patterns like building style strings, class lists, and CSS units. With no runtime dependencies and a permissive license, it's a minimal, self-contained tool for scenarios where you need to generate HTML programmatically rather than render from a template.

Use it for

  • Generate HTML email bodies or reports dynamically in Python without learning a template language.
  • Build web scraper output or data-driven HTML documents where structure depends on runtime conditions.
  • Construct HTML fragments in web frameworks (e.g., Streamlit, FastAPI) where inline Python markup is clearer than templates.
  • Programmatically create test fixtures or mock HTML responses in unit tests.
  • Generate static site content or documentation where HTML structure is computed from data structures.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you prefer writing HTML in Python and don't need frequent updates.

The package is stable, has no security vulnerabilities, and solves a real problem for developers who dislike template syntax. The dormant maintenance and source-only distribution are minor friction, but the zero runtime dependencies and permissive license make it low-risk for projects that can tolerate infrequent upstream changes.

Install

htbuilder on PyPI

Before you install

Installation friction is high—the package ships as a source distribution only. Maintenance is dormant: the last commit was 2025-01-09, but the prior release cycle was 582 days earlier, suggesting infrequent updates. The repository remains active (not archived) with 104 stars.

Requires Python 3.7 or later.

License in practice

Licensed under Apache 2 (permissive), which allows commercial and private use with minimal restrictions. No notable licensing constraints for most use cases.

Quickstart

pip install htbuilder

from htbuilder import div, ul, li

dom = div(id='container')[
  ul(_class='items')[
    li('item 1'),
    li('item 2'),
  ]
]

print(dom)

Verify before relying

  • Whether high install friction (source-only distribution) impacts real-world adoption or if wheels are available through alternative channels.
  • Performance characteristics when building large or deeply nested HTML structures.
  • Whether dormant maintenance status affects compatibility with newer Python versions beyond 3.7.

Package facts

LicenseApache 2 permissive
Python supportSupports the current Python release >=3.7
Install frictionHigh. Source build required
Runtime dependenciesNone
MaintenanceDormant 582 days since the last release
Last repo commit
First released
Downloads251,139 / month, #8,595 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Evidence: htbuilder-0.9.0.tar.gz

Tags

Capabilities
html string builder pythonfunctional html generationpython html templating alternativeprogrammatic html constructionhtml dom builderjsx-like python html
Topics
html-generationfunctional-programming

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 › “html string builder python”

  • htbuilderhtbuilder lets you construct HTML strings using Python function calls…
  • MarkupPyMarkupPy generates HTML and XML markup from Python code using an…
  • html5taggerGenerates HTML5 markup programmatically using Python syntax instead…

Give your agent the search over MCP, or paste the wish link into any chat.

More HTML packages

MarkupSafe Worth it
PyPI · Dynamic Content · released Sep 2025

MarkupSafe provides a text object that escapes special characters so untrusted strings can be safely embedded in HTML and XML without injection attacks.

BSD-3-Clausecompiled wheel · 3.9+aging
797.1Mdownloads / mo
Jinja2 Worth it
PyPI · Dynamic Content · released Mar 2025

Jinja2 is a templating engine that renders dynamic content by combining templates with Python-like syntax and data, supporting template inheritance, macros, autoescaping, and sandboxed execution.

BSD-3-Clausepure Python · 3.7+aging
718.6Mdownloads / mo
beautifulsoup4 Worth it
PyPI · Python Modules · released Jun 2026

Beautiful Soup parses HTML and XML documents into a navigable tree, providing Pythonic methods to search, iterate, and modify the parsed content.

Install it if you need to parse or extract data from markup documents.

MITpure Python · 3.7.0+
432.1Mdownloads / mo
lxml Worth it
PyPI · Python Modules · released May 2026

lxml provides Python bindings to libxml2 and libxslt, enabling parsing, validation, and transformation of XML and HTML documents through an ElementTree-compatible API with support for XPath, XSLT, and schema validation.

Install it if you need robust XML/HTML parsing, validation, or transformation; avoid it only if you must stay pure-Python and can accept slower performance.

permissive licensecompiled wheel · 3.8+
416.8Mdownloads / mo
docutils With conditions
PyPI · Software Development · released May 2026

Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.

BSD-3-Clausepure Python · 3.9+
225.6Mdownloads / mo
Markdown Worth it
PyPI · Python Modules · released Jul 2026

Converts Markdown text to HTML using a Python implementation of John Gruber's Markdown specification, with support for extensions.

Install it if you need to parse Markdown in Python.

BSD-3-Clausepure Python · 3.10+
121.7Mdownloads / mo

See also htpy · hyperscript · htmlBuilder · tinyhtml · dominate · html5tagger · htag · branca · meld3 · htmltools