The easiest way to handle env vars.
This is an opnionated utility package for handling environment variables, it handles defaults and required env vars all in one simple config file.
required:
- DB_NAME
- HOST
defaults:
TOKEN: "_token_"
HOST: "0.0.0.0"
PORT: 3000
local:
DB_NAME: pg://local
test:
DB_NAME: pg://test
pip install py-envvar==0.0.1
import os
from envvar import load # import envvar instead of py-envvar
load("./config.yaml", "local") # raises when a required env var is not set