A utility tool to create .env files
Project description
dump-env takes an .env.template file and some optional environmental variables to create a new .env file from these two sources. No external dependencies are used.
Why?
Why do we need such a tool? Well, this tool is very helpful when your CI is building docker (or other) images. Previously we had some complex logic of encrypting and decrypting files, importing secret keys and so on. Now we can just create secret variables for our CI, add some prefix to it, and use dump-env to make our life easier.
Quickstart
This quick demo will demonstrate the main and the only purpose of dump-env:
$ dump-env --template=.env.template --prefix='SECRET_ENV_' > .env
This command will:
take .env.template
parse its keys and values
read and all the variables from the environment starting with SECRET_ENV_
remove this prefix
mix it all together, where environment variables could override ones with the same name from the template
sort keys in alphabetic order
dump all the keys and values into the .env file
Installation
$ pip install dump-env
Creating secret variables in some CIs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dump-env-0.2.1.tar.gz.
File metadata
- Download URL: dump-env-0.2.1.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3c45839e2183ce86ddee7f88478b12411092b154c9a1d56ed20dd0885ff79a1
|
|
| MD5 |
686e77985743bf61d6bb4ca94acf73b7
|
|
| BLAKE2b-256 |
422414641f78d84c8e64a3c24b3166d0e93d7df4e84e774c5d1949788fb7f736
|
File details
Details for the file dump_env-0.2.1-py2.py3-none-any.whl.
File metadata
- Download URL: dump_env-0.2.1-py2.py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca07a06cffe316b42b4a7a5720b4deac62a6dcaad02f0bae431b94a1aa2cd63a
|
|
| MD5 |
6cedc72b9d1a13accdae4f7b3b5c6fcf
|
|
| BLAKE2b-256 |
60dba9056b96fb3928e914041d23f2691c33f522574e50e6fc1d3e1e3f0999b7
|