Metadata-Version: 2.4
Name: envguard-validator
Version: 2.1.0
Summary: Python wrapper for EnvGuard — validate .env files against a YAML schema
Author: EnvGuard Contributors
License: MIT
Project-URL: Homepage, https://github.com/firasmosbehi/envguard
Project-URL: Repository, https://github.com/firasmosbehi/envguard
Project-URL: Issues, https://github.com/firasmosbehi/envguard/issues
Keywords: env,dotenv,validation,schema,environment,variables
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown

<p align="center">
  <img src="https://raw.githubusercontent.com/firasmosbehi/envguard/main/docs/public/logo-icon.png" alt="EnvGuard" width="120">
</p>

# envguard-validator (Python)

> Python wrapper for EnvGuard — validate `.env` files against a declarative YAML schema.

## Install

```bash
pip install envguard-validator
```

The correct EnvGuard binary for your platform is downloaded automatically on first use.

## Quick Start

```python
from envguard import validate

result = validate(schema_path="envguard.yaml", env_path=".env")

if not result.valid:
    for error in result.errors:
        print(f"{error.key}: {error.message}")
    exit(1)

print("✓ Environment validated!")
```

## CLI

```bash
envguard-py validate --schema envguard.yaml --env .env
```

## API

### `validate(schema_path=None, env_path=None, strict=False)` → `ValidationResult`

Validates a `.env` file against a schema.

**Returns:**
- `ValidationResult.valid` — `bool`
- `ValidationResult.errors` — `list[ValidationError]`
- `ValidationResult.warnings` — `list[ValidationError]`

Each `ValidationError` has:
- `key` — variable name
- `message` — human-readable error
- `rule` — rule that failed (`required`, `type`, `pattern`, `enum`, `strict`)

## License

MIT
