skillfed

dump-env

A utility tool to create .env files

dump-env v1.7.0 95.1K downloads/30d#13,292 on PyPI119
Permissive license MIT Active released

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-env

uv

uv add dump-env

poetry

poetry add dump-env

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Tags

.env file generationenvironment variable templatingdotenv template toolCI/CD secrets managementenv file from templateprefix-based env varsdocker env file creation
ci-cdsecrets-managementdotenv

More Utilities packages