Skip to main content
https://badge.fury.io/py/dotenver.svg https://github.com/jmfederico/dotenver/actions/workflows/tests.yml/badge.svg 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

Release files for dotenver 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dotenver 1.3.0
File Size Uploaded
dotenver-1.3.0.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dotenver 1.3.0
File Interpreter ABI Platform
dotenver-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / dotenver-1.3.0.tar.gz

Download URL dotenver-1.3.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d6e49c7ec11ed3d8b760463349da3179c833ea4c899fd0c52e2b4d3edc689992
BLAKE2b-256 checksum
How to use checksums
2e92472a6d304d40cb98527f39ac7f1cf37e6f0c9d32f1188a9c18140e9fc0f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.7.4 CPython/3.11.4

Release files / dotenver-1.3.0-py3-none-any.whl

Download URL dotenver-1.3.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6a1bad980ffd9e0f29539b82221b2088771c06bcfae1105eda0a9579b425ed6
BLAKE2b-256 checksum
How to use checksums
0e938c17013a1ee0f35db60e6e4ff73804759c17eec102fe0ffa74aa7f817698
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.7.4 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page