Skip to main content

A utility tool to create .env files

Project description

Build Status Coverage Python Version Docs

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:

  1. take .env.template
  2. parse its keys and values
  3. read and all the variables from the environment starting with SECRET_ENV_
  4. remove this prefix
  5. mix it all together, where environment variables could override ones with the same name from the template
  6. sort keys in alphabetic order
  7. dump all the keys and values into the .env file

Installation

$ pip install dump-env

Creating secret variables in some CIs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
dump_env-0.2.1-py2.py3-none-any.whl (4.1 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Apr 30, 2018
dump-env-0.2.1.tar.gz (5.1 kB) Copy SHA256 hash SHA256 Source None Apr 30, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page