The pip package is python-dotenv. Its usage is very simple - whenever we need to access environment variables, we can load them from an external file called .env. Sample code has been provided on this package's PyPI page, but to summarize:
from dotenv import load_dotenv
load_dotenv() # This will allow os.getenv to access these variables
The actual file will look something like this:
KEY1=VALUE1
KEY2=VALUE2
Integration should add a .gitignore file for .env to prevent leaks. The README also has implications that this has not been tested on non-Windows OSes - this is OS-agnostic.
The pip package is
python-dotenv
. Its usage is very simple - whenever we need to access environment variables, we can load them from an external file called.env
. Sample code has been provided on this package's PyPI page, but to summarize:The actual file will look something like this:
Integration should add a
.gitignore
file for.env
to prevent leaks. The README also has implications that this has not been tested on non-Windows OSes - this is OS-agnostic.