Skip to main content

env-validator

A lightweight Python package for validating required environment variables.

Why?

Applications often depend on environment variables such as:

  • AWS credentials
  • Database connection strings
  • API keys
  • Application configuration

This package helps ensure all required variables are present before your application starts.

Installation

pip install env-validator

Usage

from env_validator import validate_env

validate_env([
    "AWS_REGION",
    "DB_HOST",
    "DB_USER"
])

Successful Validation

validate_env(["TEST_VAR"])

Returns:

True

Missing Variables

validate_env([
    "AWS_REGION",
    "DB_HOST"
])

Raises:

MissingEnvironmentVariableError

Example:

from env_validator import (
    validate_env,
    MissingEnvironmentVariableError
)

try:
    validate_env(["DB_HOST"])
except MissingEnvironmentVariableError as e:
    print(e)

Output:

Missing environment variables: DB_HOST

Running Tests

pytest -v

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smart_env_validator-0.2.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

smart_env_validator-0.2.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file smart_env_validator-0.2.1.tar.gz.

File metadata

  • Download URL: smart_env_validator-0.2.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for smart_env_validator-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ec10a25359185dd420633cd9d905a4443d711c6ecbc3d7bdbd659b8d9d7eb618
MD5 95545ac53b5d9dc8021b251d464f4ee5
BLAKE2b-256 4233f5fc01d57a81682dd0372aafec8c35e29aea32913b2155e9ee5878f14d49

See more details on using hashes here.

File details

Details for the file smart_env_validator-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for smart_env_validator-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 79aee7c8711abb6874ebf3c875f44e2e73fbadc9aa0ed59ce2e51563aa090c92
MD5 da7610458aa8652cce0f5daf53d2cb78
BLAKE2b-256 b55bdec0cd3f54035a895b70ffc12de930836de0350d5c3e5ff324e761fa5745

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page