Small utility to load, validate, and type-cast environment variables.
Project description
dragon-env
Small, clean utility to load, validate, and type-cast environment variables (with automatic .env loading).
Installation
pip install dragon-env
Basic usage
from dragon_env import env, EnvError
PORT = env("PORT", cast=int)
DEBUG = env("DEBUG", default=False, cast=bool, required=False)
try:
DATABASE_URL = env("DATABASE_URL")
except EnvError as e:
raise SystemExit(str(e))
Example .env
PORT=8000
DEBUG=true
DATABASE_URL=postgresql://user:pass@localhost:5432/app
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
dragon_env-0.1.0.tar.gz
(3.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dragon_env-0.1.0.tar.gz.
File metadata
- Download URL: dragon_env-0.1.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc4d3e378d92417b8f24d83347b4c5c6c78d95bbfdbacee59bf2a22ed09c90ea
|
|
| MD5 |
7123525d3faa2c5d5512defaf64c3c86
|
|
| BLAKE2b-256 |
69e950637e5c644719884dda594ee2ed7bca02f80f016ef39e6ec4a6291f014a
|
File details
Details for the file dragon_env-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dragon_env-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b815e9c86cbeb4f31557577b513c0606e3236166691d1ed54406353dd2ad1d5
|
|
| MD5 |
8db88d368ec2aa4ab2f0310df63acc4c
|
|
| BLAKE2b-256 |
4a685b0177405d9e8326f79e38c8288363712b73f7dd6015f74c64e0330463c5
|