empy
A templating system for Python.
What it is and what it does
EmPy is a mature templating engine that lets you write Python code directly into template text using a customizable prefix (typically `@`) to mark where Python should execute. It processes a source document containing mixed text and Python markup, evaluates the Python portions, and outputs the results combined with the surrounding text. This turns Python into a markup language for code generation, document preprocessing, and text transformation.
The package has no runtime dependencies and supports a wide range of Python implementations (CPython, PyPy, Jython, IronPython, Stackless). It's designed for developers who want lightweight, inline code generation without the overhead of a full templating framework. The aging maintenance status (last release 186 days ago) reflects a stable, mature tool rather than an actively developed one.
Use it for:
- Generate configuration files or source code by embedding Python logic in template text.
- Preprocess documentation or markup files where dynamic content is computed from Python expressions.
- Build simple code generators or boilerplate factories that mix static text with programmatic output.
- Create custom report or document templates that evaluate Python at render time.
- Automate repetitive text generation tasks in build pipelines or CI workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
EmPy is a templating system that embeds Python code directly into text documents using customizable markup (default `@`), processing the combined source to produce output with Python expressions, statements, and control structures evaluated inline.
Yes, if you need lightweight inline templating without framework overhead and accept that maintenance is stable but not active. The permissive BSD license, zero runtime dependencies, and broad Python support make it low-risk for stable use cases. High install friction and aging status suggest it's best for established projects or one-off scripts rather than new, evolving applications.
Install
empy on PyPI
pip
pip install empyuv
uv add empypoetry
poetry add empyInstalling empy
Before you install
Installation friction is high; the package is aging (186 days since last release) with mature status but no recent repository activity signals available. Suitable for stable, long-term use cases where active maintenance is not a priority.
License in practice
BSD license is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute EmPy freely provided you retain the license notice.
Quickstart
pip install empy
import empy
empy.expand('@(2 + 2)', output=open('out.txt', 'w'))
Requires Python >=2.4; no external runtime dependencies, but template processing depends on Python's eval/exec semantics.
Verify before relying
- Whether the package runs reliably on modern Python 3 versions despite aging maintenance status.
- Performance characteristics and scalability limits for large template files or complex embedded code.
- Availability of comprehensive documentation or examples beyond the homepage.
Package facts
| License | BSD (permissive) |
| Python support | supports the current Python release (>=2.4) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | aging — 186 days since the last release |
| First released | |
| Downloads | 691,099/month — #5,328 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: empy-4.2.1.tar.gz
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
DocumentTemplateDocumentTemplate implements the Document…
unclear · top 15,000 on PyPI
GenshiGenshi is a Python library for parsing,…
permissive · top 15,000 on PyPI
jsonnetJsonnet is a data templating language that…
permissive · top 5,000 on PyPI
hyperscriptHyperscript lets you generate HTML markup…
permissive · top 15,000 on PyPI
adaptive-cards-templating-pyExpands Adaptive Card templates by substituting…
permissive · top 15,000 on PyPI
PlimPlim translates a concise Ruby-inspired…
permissive · top 15,000 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
MarkupPyMarkupPy generates HTML and XML markup from…
permissive · top 5,000 on PyPI
pyymlEmbeds Python expressions directly in YAML…
permissive · top 15,000 on PyPI