skillfed

airium

Easy and quick html builder with natural syntax correspondence (python->html). No templates needed. Serves pure pythonic library with no dependencies.

airium v0.2.7 97.0K downloads/30d#13,182 on PyPI
Permissive license MIT AGING released

What it is and what it does

Airium is a Python library that generates HTML by treating DOM structure as Python indentation and context managers, eliminating the need for separate template files. Instead of writing HTML templates, you write Python code where nesting is expressed through `with` statements, and element attributes and text are passed as function arguments. The library supports both pretty-printed (indented, human-readable) and minified output modes.

The package also includes a reverse translator to parse existing HTML back into Python code. It has no external dependencies, works across Python 3.8 through 3.13 and PyPy, and can be integrated into web frameworks like Flask or Django to replace template engines entirely. Output can be cast to string or UTF-8 bytes directly.

Use it for:

  • Generate HTML programmatically in Flask or Django views without writing separate template files
  • Build dynamic HTML tables, forms, or page structures where the layout is determined by Python logic
  • Create minified HTML output for production when file size matters
  • Convert existing HTML documents into Python code for programmatic manipulation
  • Generate email HTML bodies or static site content from pure Python

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Airium generates HTML from Python code using indentation and context managers instead of templates, and can also parse HTML back into Python.

Yes, if you prefer writing HTML in Python over templates and want zero external dependencies. The package is stable (Beta status, no known vulnerabilities) but aging—last release was 430 days ago. Suitable for small to medium projects; verify performance and framework integration for your specific use case before adopting in production.

Install

airium on PyPI

pip

pip install airium

uv

uv add airium

poetry

poetry add airium

Installing airium

Before you install

No runtime dependencies and a pure-Python wheel distribution make installation straightforward. The package is aging (430 days since last release) but carries a Beta status and has received recent maintenance as of 2025-06-10.

License in practice

MIT license is permissive, allowing free use, modification, and distribution in both open-source and proprietary projects with minimal restrictions.

Quickstart

from airium import Airium

a = Airium()
a('<!DOCTYPE html>')
with a.html():
    with a.body():
        a.h1(_t='Hello World')
print(str(a))

Verify before relying

  • Whether the reverse translator (HTML to Python) is production-ready or limited to specific HTML patterns
  • Performance characteristics when generating large or deeply nested HTML documents
  • Compatibility with modern web frameworks beyond the Django example shown

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 430 days since the last release
First released
Downloads 96,967/month — #13,182 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: airium-0.2.7-py3-none-any.whl

Keywords: natural, html, generator, compiler, template-less

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchIntended Audience :: System AdministratorsIntended Audience :: Telecommunications IndustryOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: PyPyTopic :: Database :: Front-EndsTopic :: DocumentationTopic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: BrowsersTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Scientific/Engineering :: VisualizationTopic :: Software Development :: Code GeneratorsTopic :: Text Processing :: Markup :: HTMLTopic :: Utilities

Tags

html generator pythontemplate-less html builderpython to html converterhtml to python translatordom structure python indentationprogrammatic html generationno-template web markup
html-generationtemplate-freecode-generator

More WWW/HTTP packages