--- id: yattag version: "1.16.1" license: unclear license_treatment: copyleft maintenance: dormant --- # 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. License: copyleft · Maintenance: dormant · Downloads: 821.7K/mo ## 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 above — verify before relying. Yattag generates HTML or XML documents using Python code with context managers instead of template strings, letting you build nested markup programmatically with readable syntax. 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 pip install yattag uv add yattag poetry add yattag ## Installing yattag 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: not declared (copyleft) - Python support: unspecified - Install friction: high - Maintenance: dormant - Downloads: 821.7K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags html generation python, xml document builder, python template alternative, programmatic html markup, form rendering with defaults, html without templates, nested tag builder, html-generation, markup-builder, form-rendering [View on SkillFed](https://skillfed.io/packages/yattag) · [View on PyPI](https://pypi.org/project/yattag/)