A Python app to generate dotenv (.env) files from templates.
- Automatic .env file generation from .env.example files
- Useful for CI or Docker deployments
- Uses Jinja2 as rendering engine
- Uses Faker for value generation
Install Python DotEnver
$ pip install dotenver
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
Run python DotEnver form the CLI
$ dotenver -r
You now have a new .env file ready to use.
For more usage options run
$ dotenver -h
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