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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec10a25359185dd420633cd9d905a4443d711c6ecbc3d7bdbd659b8d9d7eb618
|
|
| MD5 |
95545ac53b5d9dc8021b251d464f4ee5
|
|
| BLAKE2b-256 |
4233f5fc01d57a81682dd0372aafec8c35e29aea32913b2155e9ee5878f14d49
|
File details
Details for the file smart_env_validator-0.2.1-py3-none-any.whl.
File metadata
- Download URL: smart_env_validator-0.2.1-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79aee7c8711abb6874ebf3c875f44e2e73fbadc9aa0ed59ce2e51563aa090c92
|
|
| MD5 |
da7610458aa8652cce0f5daf53d2cb78
|
|
| BLAKE2b-256 |
b55bdec0cd3f54035a895b70ffc12de930836de0350d5c3e5ff324e761fa5745
|