Manage your app configuration using env variables
Project description
Envia
Did you ever lose track of all environment variables you can use to configure a project? Envia is a simple utility that allows you to group them together.
Installation
pip install envia
Usage
You can use Envia as follows
# app/config.py
from envia import EnvVar
APP_DB_VENDOR = EnvVar("APP_DB_VENDOR", default="postgres")
APP_DB_PORT = EnvVar("APP_DB_PORT", default="5432")
APP_DB_HOST = EnvVar("APP_DB_HOST")
To use the environment values you can do
# app/db.py
import app.config as cfg
def connect():
vendor = cfg.APP_DB_VENDOR.get_required()
port = cfg.APP_DB_PORT.get_required()
host = cfg.APP_DB_PORT.get_required()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
envia-0.0.0.tar.gz
(4.6 kB
view hashes)
Built Distribution
envia-0.0.0-py3-none-any.whl
(4.9 kB
view hashes)