Lib útil do Python para carregar envs de um arquivo local.

https://github.com/theskumar/python-dotenv

Instalação

pip install python-dotenv

Uso

from dotenv import load_dotenv
 
load_dotenv()  # take environment variables
 
# Code of your application, which uses environment variables (e.g. from `os.environ` or
# `os.getenv`) as if they came from the actual environment.