py-envvar

Easiest way to deal with env vars


Keywords
env, environment, variables
License
MIT
Install
pip install py-envvar==0.0.1

Documentation

py-envvar

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.


Code style: black Build

Example config yaml

required:
  - DB_NAME
defaults:
  TOKEN: "_token_"
  HOST: "0.0.0.0"
  PORT: 3000
local:
  DB_NAME: pg://local
test:
  DB_NAME: pg://test

Installation

pip install py-envvar==0.0.1

Usage

import os
from envvar import load # pip installs py-envvar but import is envvar only

load("./config.yaml", "local")