yattag
Generate HTML or XML in a pythonic way. Pure python alternative to web template engines.Can fill HTML forms with default values and error messages.
Decision gist · record as of 2026-08-14
Yes, if you prefer code-based HTML generation over templates and accept the maintenance risk. The package is stable with no known vulnerabilities, but dormant status and high install friction mean you should verify Python version compatibility for your target runtime before committing. Suitable for small projects or scripts where template overhead is unwelcome; risky for production systems requiring active maintenance.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- High install friction and dormant maintenance status (650 days since last release) suggest limited active support; the package carries Python 2 classifiers but no explicit requires_python constraint, creating uncertainty about actual compatibility with modern Python versions.
License · maintenance · safety
copyleft license (copyleft) — Copyleft LGPL license means code using yattag must comply with LGPL terms; derivative works and modifications require source disclosure under the same license.
last release 2024-11-02 (650 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 821,703 downloads/mo, #4,973 on PyPI
Alternatives
Verify before relying
from yattag import Doc
doc, tag, text = Doc().tagtext()
with tag('html'):
with tag('body'):
with tag('h1'):
text('Hello world!')
print(doc.getvalue())- Whether the package actually supports modern Python versions despite listing Python 2.6 and 2.7 in classifiers with no explicit requires_python
- Current state of the GitHub repository and whether the project is actively maintained despite the dormant status signal
- Actual download volume and production usage patterns given the dormant maintenance status
What it is and what it does
Yattag is a Python library for generating HTML and XML documents by writing code instead of using template engines. You build markup using context managers (with statements) that represent nested tags, making the document structure visually match the code indentation. The library also provides special methods for rendering HTML forms with default values and error messages pre-filled.
The package depends only on the standard library's typing module and is designed as a lightweight alternative to template engines. It trades template syntax for pure Python, which can be more readable for some use cases but requires more explicit code. The project is classified as dormant with no release in 650 days, and carries classifiers for Python 2 versions without a declared requires_python constraint, creating ambiguity about actual modern Python support.
Use it for
- Generate HTML forms with pre-filled default values and error message display without a separate template file
- Build XML documents programmatically where the Python code structure mirrors the document hierarchy
- Create HTML snippets or full pages in web applications that prefer code-based markup over template syntax
- Render dynamic HTML in scripts or tools where a full template engine feels like overkill
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you prefer code-based HTML generation over templates and accept the maintenance risk.
The package is stable with no known vulnerabilities, but dormant status and high install friction mean you should verify Python version compatibility for your target runtime before committing. Suitable for small projects or scripts where template overhead is unwelcome; risky for production systems requiring active maintenance.
Install
yattag on PyPI
Before you install
High install friction and dormant maintenance status (650 days since last release) suggest limited active support; the package carries Python 2 classifiers but no explicit requires_python constraint, creating uncertainty about actual compatibility with modern Python versions.
License in practice
Copyleft LGPL license means code using yattag must comply with LGPL terms; derivative works and modifications require source disclosure under the same license.
Quickstart
from yattag import Doc
doc, tag, text = Doc().tagtext()
with tag('html'):
with tag('body'):
with tag('h1'):
text('Hello world!')
print(doc.getvalue())
Verify before relying
- Whether the package actually supports modern Python versions despite listing Python 2.6 and 2.7 in classifiers with no explicit requires_python
- Current state of the GitHub repository and whether the project is actively maintained despite the dormant status signal
- Actual download volume and production usage patterns given the dormant maintenance status
Package facts
| License | copyleft license copyleft |
| Python support | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | 1 packagetyping |
| Maintenance | Dormant 650 days since the last release |
| First released | |
| Downloads | 821,703 / month, #4,973 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)Operating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Libraries :: Python Modules |
Evidence: yattag-1.16.1.tar.gz
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 › “xml document builder”
- yattagYattag generates HTML or XML documents using Python code with context…
- cssselectcssselect parses CSS3 selectors and translates them to XPath 1.0…
- 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 · htmltools · MarkupPy · Genshi · hyperscript · empy · htpy · tinyhtml · branca · Chameleon