Skip to main content

Automatically generate .env files from .env.example template files

Project description

https://badge.fury.io/py/dotenver.svg https://travis-ci.org/jmfederico/dotenver.svg?branch=master https://img.shields.io/badge/code%20style-black-000000.svg

A Python app to generate dotenv (.env) files from templates.

Features

  • Automatic .env file generation from .env.example files

  • Useful for CI or Docker deployments

  • Uses Jinja2 as rendering engine

  • Uses Faker for value generation

Quickstart

  1. Install Python DotEnver

    $ pip install dotenver
  2. Create a .env.example following this example

    # Full line comments will be kept
    
    # Simple usage
    NAME= ## dotenver:first_name
    
    # Pass parameters to fakers
    ENABLED= ## dotenver:boolean(chance_of_getting_true=50)
    
    # Name your values
    MYSQL_PASSWORD= ## dotenver:password:my_password(length=20)
    # And get the same value again, when the name is repeated.
    DB_PASSWORD= ## dotenver:password:my_password()
    
    # Output your values within double or single quotes
    DOUBLE_QUOTED= ## dotenver:last_name(quotes='"')
    SINGLE_QUOTED= ## dotenver:last_name(quotes="'")
    
    # Literal values are possible
    STATIC_VARIABLE=static value
    
    # export syntax can be used
    export EXPORTED_VARIABLE=exported
  3. Run python DotEnver form the CLI

    $ dotenver -r
  4. You now have a new .env file ready to use.

  5. For more usage options run

    $ dotenver -h

Docker

A Docker image is provided. To use it, mount your source code to /var/lib/dotenver/ and run the container.

$ docker run -ti --rm -v "${PWD}:/var/lib/dotenver/" jmfederico/dotenver

Project details


Download files

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

Source Distribution

dotenver-1.1.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

dotenver-1.1.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file dotenver-1.1.1.tar.gz.

File metadata

  • Download URL: dotenver-1.1.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.5 Darwin/19.6.0

File hashes

Hashes for dotenver-1.1.1.tar.gz
Algorithm Hash digest
SHA256 62a36a6cedd495ad14f6f05359d5fa7daeb3912a9f8e06e9633b74bfc02ce120
MD5 06f6729c039f2f75af79c7fe4f9cc87b
BLAKE2b-256 95b15a2b2c3050a6d82e5364ae386201aa73f23beb3f8b5f0ec83c5a8fe262fb

See more details on using hashes here.

File details

Details for the file dotenver-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: dotenver-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.5 Darwin/19.6.0

File hashes

Hashes for dotenver-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be29ad5e5aba8f761ad14d1bfdd4a9a6c88f03baec4ab8fab14b56d680c8d514
MD5 ddbddee284b3df58577d44e471bde6b4
BLAKE2b-256 7d7f56652e24f29eec57a3bce54bfa2c057a64391088df4bb4f1c7266575ad0c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page