This repository contains small scripts as well as instructions to read .env files in several languages.
For using it in python first you have to have:
Optionally having a python virtual enviroment.
Installed the python-dotenv package. You can do it just by running pip install python-dotenv
.
For a .env
file like this:
from os import environ
from dotenv import load_dotenv
load_dotenv(".env")
DB_NAME = environ["DB_NAME"]
print(DB_NAME)