Env Wrangler
Overview
Extract secrets from .env files into their own file (either .secrets or secrets.json). Also provides mask and unmask options. The resulting secrets file can be leveraged to get your secrets into a 3rd party secrets manager like AWS Secrets Manager or something else.
Plays nice with cookiecutter-django.
Installation
python3 -m pip install env-wrangler
Usage
The path parameter is a directory, not a file!
env-wrangler extract --path ".envs/.production"
# Only run if you've previously run extract
env-wrangler mask --path ".envs/.production"
env-wrangler unmask --path ".envs/.production"
NOTE: For help run
env-wrangler --helpor for a specific command runenv-wrangler {command} --help.
On first run, env-wrangler creates ~/.env-wrangler/env-wrangler.toml.
The default config section supports:
key_words: substrings used to identify secret-like keysignore_keys: exact keys to skip even if they matchkey_wordsenvs: env files to scan (for example.env,.django,.postgres)
Development
just --list
just env
just pip-install-editable
Testing
just pytest
just coverage
just open-coverage
For quick local quality checks:
just check
Issues
If you experience any issues, please create one in the Bitbucket issue tracker.
History
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
0.1.7 (2026-04-22)
- Moved project tooling and packaging workflow to Hatch and
xapp-tools. - Improved automated test coverage, including CLI command coverage updates.
- Removed
pkg_resourcesusage and moved resource loading toimportlib.resources.
0.1.6 (2025-03-31)
- Fixed missing dependency and data file.
0.1.5 (2024-04-23)
- Moved from
configparsertotomlfor configuration.
0.1.4 (2024-04-19)
- Bug fix when getting key from .env file for comparision
0.1.3 (2024-04-19)
- Added
ignore_keysto config for keys (exact key names) to always ignore even if they containkey_word.
0.1.2 (2024-04-18)
- Bug fix for if a env value contains an "=". We only split on the first "=" so we get key,value from .env.
0.1.1 (2024-04-18)
- Write secrets files non-destructively
- Sort keys for secrets files
0.1.0 (2024-04-15)
- First release
Metadata
Release files for env-wrangler 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| env_wrangler-0.1.7.tar.gz | 76.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| env_wrangler-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 85.2 kB
Release files / env_wrangler-0.1.7.tar.gz
| Download URL | env_wrangler-0.1.7.tar.gz |
|---|---|
| Size | 76.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6b93a4231514a34b267e8165f5da9247b36f1be858b7ee34727218d19acd9e52
|
|
BLAKE2b-256 checksum How to use checksums |
0a40095efaf87fa86b71e444bf6ada4933dfdb1d247843fbc168c5a929895950
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Release files / env_wrangler-0.1.7-py3-none-any.whl
| Download URL | env_wrangler-0.1.7-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
642e3bf2fcebe61b698210c4648aa42b5ea8dc65cd3ae8832976a3476f040e06
|
|
BLAKE2b-256 checksum How to use checksums |
2462bf36f5858118b1bc32b6f2cdc4b742b6f1c8283cb122b00b739fffacd828
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|