skillfed

empy

A templating system for Python.

empy v4.2.1 691.1K downloads/30d#5,328 on PyPI
Permissive license BSD AGING released

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 empy

uv

uv add empy

poetry

poetry add empy

Installing 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

Development Status :: 6 - MatureEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Other AudienceLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: IronPythonProgramming Language :: Python :: Implementation :: JythonProgramming Language :: Python :: Implementation :: PyPyProgramming Language :: Python :: Implementation :: StacklessTopic :: Software Development :: InterpretersTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Pre-processorsTopic :: Text Editors :: Text ProcessingTopic :: Text Processing :: FiltersTopic :: Text Processing :: GeneralTopic :: Text Processing :: MarkupTopic :: Utilities

Tags

python templating systemembed python in texttemplate preprocessingpython markup languagecode generation from templatestext processing with pythontemplate expansion
code-generationpreprocessing

More Python Modules packages