dump-env
A utility tool to create .env files
What it is and what it does
dump-env is a command-line tool that generates .env files by reading an .env.template file and overlaying environment variables that match one or more specified prefixes. It has no external dependencies and runs as a pure Python utility. The tool is designed to simplify CI/CD workflows—particularly Docker image builds—where secrets and configuration need to be injected from CI provider environment variables without manual encryption/decryption logic.
The typical workflow is: define a template with default or placeholder values, set prefixed environment variables in your CI system (e.g., SECRET_ENV_DATABASE_URL), and run dump-env to merge them. The tool can enforce strict validation (fail if required variables are missing), support multiple prefixes, and optionally disable value quoting for compatibility with linters like dotenv-linter.
Use it for:
- Generate .env files in Docker builds by reading CI secrets prefixed with a convention like SECRET_ENV_.
- Enforce that all required environment variables are present before deploying, using the --strict flag.
- Merge multiple sources of configuration: a template for defaults and environment-specific overrides from CI.
- Create .env files in GitLab CI, GitHub Actions, or Travis CI without custom shell scripting.
- Validate that template variables are defined in the environment before exporting to .env.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates .env files by merging an .env.template with environment variables matching specified prefixes, with optional strict validation and source filtering.
Yes. dump-env is a lightweight, actively maintained utility with zero dependencies, a permissive license, and a clear single purpose: simplifying .env generation in CI/CD pipelines. Install it if you manage environment configuration across Docker builds or CI systems and want to avoid shell scripting or manual secret handling.
Install
dump-env on PyPI
pip
pip install dump-envuv
uv add dump-envpoetry
poetry add dump-envInstalling dump-env
Before you install
Low friction: pure Python wheel with zero runtime dependencies. Actively maintained as of 2026-04-20, last commit 2026-08-10, and marked Production/Stable.
License in practice
MIT license (permissive) — you may use, modify, and distribute freely with minimal restrictions.
Quickstart
$ pip install dump-env
$ dump-env --template=.env.template --prefix='SECRET_ENV_' > .env
Or in Python:
from dump_env import dump_env
# Command-line tool; no direct Python API documented
Requires Python 3.10 or later (supports 3.10, 3.11, 3.12, 3.13, 3.14).
Verify before relying
- Whether a programmatic Python API exists beyond the CLI tool documented in the excerpt.
- Performance characteristics when processing very large template files or many prefixed variables.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 116 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 95,078/month — #13,292 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dump_env-1.7.0-py3-none-any.whl
Keywords: dotenv, .env, templates, secrets, CI/CD
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
dotenv-linterLints `.env` files for consistency violations…
permissive · top 15,000 on PyPI
envtplRenders Jinja2 templates on the command line,…
copyleft · top 15,000 on PyPI
environsenvirons parses environment variables into…
permissive · top 5,000 on PyPI
poetry-dotenv-pluginA Poetry plugin that automatically loads…
permissive · top 15,000 on PyPI
jinjanatorA command-line tool that renders Jinja2…
permissive · top 5,000 on PyPI
pytest-dotenvA pytest plugin that automatically loads…
permissive · top 5,000 on PyPI
dynaconfDynaconf manages application configuration…
permissive · top 5,000 on PyPI
expandvarsExpands Unix-style variable references in…
permissive · top 5,000 on PyPI
django-split-settingsSplits Django settings across multiple files…
permissive · top 15,000 on PyPI
python-dotenvReads key-value pairs from a .env file and sets…
permissive · top 100 on PyPI