Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dragon_env-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

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

Hashes for dragon_env-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dc4d3e378d92417b8f24d83347b4c5c6c78d95bbfdbacee59bf2a22ed09c90ea
MD5 7123525d3faa2c5d5512defaf64c3c86
BLAKE2b-256 69e950637e5c644719884dda594ee2ed7bca02f80f016ef39e6ec4a6291f014a

See more details on using hashes here.

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

Hashes for dragon_env-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b815e9c86cbeb4f31557577b513c0606e3236166691d1ed54406353dd2ad1d5
MD5 8db88d368ec2aa4ab2f0310df63acc4c
BLAKE2b-256 4a685b0177405d9e8326f79e38c8288363712b73f7dd6015f74c64e0330463c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page