dominate
Dominate is a Python library for creating and manipulating HTML documents using an elegant DOM API.
Decision gist · record as of 2026-08-14
Yes. Dominate is a mature, actively maintained library with no dependencies, broad Python version support, and no known vulnerabilities. The copyleft license (LGPL-3.0) requires source disclosure if you distribute the library itself, but poses no barrier for internal or open-source use. Install it if you prefer writing HTML in Python over templates or string manipulation.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Installation is straightforward with no runtime dependencies.
- The package is actively maintained with recent commits and a stable release history since 2013, supporting current Python versions (3.7–3.12 and PyPy).
License · maintenance · safety
LGPL-3.0-or-newer (copyleft) — Dominate is licensed under LGPL-3.0-or-newer (copyleft). If you distribute software that links or bundles this library, you must make your source code available under compatible terms.
last release 2023-12-24 (964 days) · last repo commit 2026-05-09 · 1,826 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,148,985 downloads/mo, #3,253 on PyPI
Alternatives
Verify before relying
pip install dominate
import dominate
from dominate.tags import div, p, html, body
doc = dominate.document(title='Example')
with doc:
with div(id='content'):
p('Hello, World!')
print(doc)- Performance characteristics when generating very large HTML documents or deeply nested structures.
- Whether the library supports HTML5 semantic elements beyond standard tag coverage.
What it is and what it does
Dominate provides a Pythonic way to construct HTML by treating each HTML element as a Python class. You instantiate tags, nest them using context managers or method chaining, set attributes via keyword arguments or dictionary-like access, and render the result to a string. The library eliminates the need to write raw HTML or learn a separate templating syntax—instead, you write pure Python code that reads naturally and lets you use Python's full feature set (loops, conditionals, functions) to generate markup.
The package is lightweight with zero runtime dependencies and works across Python 3.7 through 3.12 as well as PyPy. It supports both human-readable pretty-printing and compact rendering, handles HTML5 data attributes, provides shortcuts for reserved keywords like `class` and `for`, and allows you to build reusable widget functions using decorators. It's commonly used for server-side HTML generation, dynamic page building, and creating HTML-based reports or documentation.
Use it for
- Generate HTML pages dynamically in web frameworks without a separate template engine.
- Build reusable HTML components as decorated Python functions for modular page construction.
- Create HTML reports or documentation programmatically from Python data structures.
- Generate email templates or HTML content in backend services without string concatenation.
- Prototype or test HTML structures in Python without writing raw markup strings.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Dominate is a mature, actively maintained library with no dependencies, broad Python version support, and no known vulnerabilities. The copyleft license (LGPL-3.0) requires source disclosure if you distribute the library itself, but poses no barrier for internal or open-source use. Install it if you prefer writing HTML in Python over templates or string manipulation.
Install
dominate on PyPI
Before you install
Installation is straightforward with no runtime dependencies. The package is actively maintained with recent commits and a stable release history since 2013, supporting current Python versions (3.7–3.12 and PyPy).
License in practice
Dominate is licensed under LGPL-3.0-or-newer (copyleft). If you distribute software that links or bundles this library, you must make your source code available under compatible terms.
Quickstart
pip install dominate
import dominate
from dominate.tags import div, p, html, body
doc = dominate.document(title='Example')
with doc:
with div(id='content'):
p('Hello, World!')
print(doc)
Verify before relying
- Performance characteristics when generating very large HTML documents or deeply nested structures.
- Whether the library supports HTML5 semantic elements beyond standard tag coverage.
Package facts
| License | LGPL-3.0-or-newer copyleft |
| Python support | Supports the current Python release >=3.4 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 964 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,148,985 / month, #3,253 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 :: GNU Lesser General Public License v3 (LGPLv3)Operating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: PyPyTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: Markup :: HTML |
Evidence: dominate-2.9.1-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 › “python html generation”
- dominateDominate is a Python library for writing HTML documents…
- htpyhtpy lets you write HTML directly in Python using bracket syntax and…
- MarkupPyMarkupPy generates HTML and XML markup from Python code using an…
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 · htmlBuilder · hyperscript · htbuilder · htpy · airium · branca · meld3 · htmltools · braq