Skip to main content

A utility tool to create .env files

Project description

A utility tool to create ``.env`` files

.. image::

.. image::

.. image::

.. image::

.. image::

``dump-env`` takes an ``.env.template`` file and some optional environmental variables to create a new ``.env`` file from these two sources.


This quick demo will demonstrate the main and the only purpose of ``dump-env``:

.. code:: bash

$ 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


.. code:: bash

$ pip install dump-env


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.

Creating secret variables in some CIs

- ``travis``: `docs <>`_
- ``gitlab-ci``: `docs <>`_

Project details

Download files

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

Files for dump-env, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size dump_env-0.1.0-py2-none-any.whl (6.0 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size dump_env-0.1.0-py3-none-any.whl (6.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size dump-env-0.1.0.tar.gz (4.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page