python-dotenv
python-dotenv copied to clipboard
Feature Request: Generating .env.example file from a .env file
Hi,
Sometimes we can not share .env file. However it would be useful if we could generate a .env.example
from it which contains all the comments and keys name in it. For example, suppose .env
has the following content,
# this is comment
API_SECRET_KEY=some-value
Then generated .env.example
file has the following content,
# this is comment
API_SECRET_KEY=
It would be useful if a CLI
command is provided for it.
Thanks
I'll work on this soon.
I just made a function that does this, but I still have to incorporate it into the cli. Will do it tonight.
this is comment
API_SECRET_KEY=some-value
Something cool about an .env.example
file is that it can not only be used for human reference purposes, but also to facilitate an opt-in programmatic safety feature. The example file can be shipped with an application, then read at runtime and used to establish a list of the names of variables that must be defined. See the dotenv module in Deno's standard library: https://deno.land/[email protected]/dotenv#safe-mode