Metadata-Version: 2.4
Name: smart-env-validator
Version: 0.2.1
Summary: Validate required environment variables
Author: Manish Maheshwari
License: MIT
Project-URL: Homepage, https://github.com/maheshwarimanish/env-validator
Project-URL: Repository, https://github.com/maheshwarimanish/env-validator
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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

```bash
pip install env-validator
```

## Usage

```python
from env_validator import validate_env

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

### Successful Validation

```python
validate_env(["TEST_VAR"])
```

Returns:

```python
True
```

### Missing Variables

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

Raises:

```python
MissingEnvironmentVariableError
```

Example:

```python
from env_validator import (
    validate_env,
    MissingEnvironmentVariableError
)

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

Output:

```text
Missing environment variables: DB_HOST
```

## Running Tests

```bash
pytest -v
```

## License

MIT
