envtpl
Render jinja2 templates on the command line using shell environment variables
Decision gist · record as of 2026-08-14
Yes, if you need lightweight, shell-native template rendering for configuration files in Docker or deployment contexts. The single dependency, active maintenance, and lack of known vulnerabilities make it low-risk. The GPL v3 license requires review if you plan to redistribute or embed it in proprietary software; for internal use it is unproblematic. Not necessary if your deployment tool (Helm, Terraform, etc.) already handles templating.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; environment variables must be set in the shell before invocation.
- Installs cleanly with a single runtime dependency (Jinja2) and no compiled components.
- Active maintenance with recent commits; last release 148 days ago.
License · maintenance · safety
GPL v3 (copyleft) — Licensed under GPL v3 (copyleft). Any derivative work or bundled distribution must also be GPL v3; suitable for internal tools and open-source projects but requires careful review in proprietary contexts.
last release 2026-03-19 (148 days) · last repo commit 2026-08-11 · 244 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 124,923 downloads/mo, #11,846 on PyPI
Alternatives
Verify before relying
pip install envtpl
# Create template file (config.conf.tpl):
# foo = {{ FOO }}
# bar = "{{ BAR | default("default_value") }}"
# Render from command line:
# FOO=123 BAR=abc envtpl config.conf.tpl
# Output: config.conf with variables substituted- Whether the package handles special characters or escaping in environment variable values reliably.
- Performance characteristics when processing very large template files or many environment variables.
What it is and what it does
envtpl is a command-line tool that processes Jinja2 templates by injecting shell environment variables into them. It reads a template file (typically with a .tpl extension), substitutes variables using Jinja2 syntax, and writes the rendered output to a file or stdout. The tool supports default values, conditional blocks, and a special environment() function to match variables by prefix—all standard Jinja2 features accessible from the shell.
The primary use case is Docker container initialization, where configuration files need to be generated at runtime with values from the container environment. By default, envtpl deletes the input template after rendering (though this can be disabled with --keep-template). It handles missing variables by throwing an error unless --allow-missing is passed, which substitutes empty strings instead.
Use it for
- Generate Docker container configuration files at startup by substituting environment variables into template files.
- Create deployment-specific config files (nginx, Redis, etc.) from a single template with environment-driven values.
- Build shell scripts or application configs that vary by environment (dev, staging, prod) without duplicating files.
- Conditionally include or exclude configuration sections based on whether specific environment variables are defined.
- Batch-process multiple template files in a CI/CD pipeline to inject build metadata or secrets.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need lightweight, shell-native template rendering for configuration files in Docker or deployment contexts.
The single dependency, active maintenance, and lack of known vulnerabilities make it low-risk. The GPL v3 license requires review if you plan to redistribute or embed it in proprietary software; for internal use it is unproblematic. Not necessary if your deployment tool (Helm, Terraform, etc.) already handles templating.
Install
envtpl on PyPI
Before you install
Installs cleanly with a single runtime dependency (Jinja2) and no compiled components. Active maintenance with recent commits; last release 148 days ago.
Requires Python 3.10 or later; environment variables must be set in the shell before invocation.
License in practice
Licensed under GPL v3 (copyleft). Any derivative work or bundled distribution must also be GPL v3; suitable for internal tools and open-source projects but requires careful review in proprietary contexts.
Quickstart
pip install envtpl
# Create template file (config.conf.tpl):
# foo = {{ FOO }}
# bar = "{{ BAR | default("default_value") }}"
# Render from command line:
# FOO=123 BAR=abc envtpl config.conf.tpl
# Output: config.conf with variables substituted
Verify before relying
- Whether the package handles special characters or escaping in environment variable values reliably.
- Performance characteristics when processing very large template files or many environment variables.
Package facts
| License | GPL v3 copyleft |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageJinja2 |
| Maintenance | Actively maintained 148 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 124,923 / month, #11,846 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: GNU General Public License v3 (GPLv3)Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: envtpl-0.8.0-py3-none-any.whl
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 › “environment variable template substitution”
- envtplRenders Jinja2 templates on the command line, substituting shell…
- TempitaTempita is a lightweight templating engine that processes text…
- python-liquidPython Liquid is a template engine that renders Liquid templates—a…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities 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.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
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.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also j2cli · jinja2-cli · ruamel.yaml.jinja2 · django-jinja · Jinja2 · dump-env · aiohttp-jinja2 · jinjanator · jinja-cli · git-changelog