Metadata-Version: 2.4
Name: envdrift
Version: 3.3.1
Summary: Prevent environment variable drift with Pydantic schema validation, pre-commit hooks, and dotenvx encryption
Project-URL: Homepage, https://github.com/jainal09/envdrift
Project-URL: Documentation, https://jainal09.github.io/envdrift
Project-URL: Repository, https://github.com/jainal09/envdrift
Project-URL: Issues, https://github.com/jainal09/envdrift/issues
Author-email: Jainal Gosaliya <gosaliya.jainal@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: aws,azure,config,dotenv,dotenvx,drift,encryption,environment,hashicorp,pre-commit,pydantic,schema,secrets,validation,variables,vault
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: pydantic-settings>=2.0
Requires-Dist: pydantic>=2.0
Requires-Dist: python-dotenv>=1.0
Requires-Dist: rich>=13.0
Requires-Dist: typer>=0.9
Provides-Extra: all
Requires-Dist: azure-identity>=1.15; extra == 'all'
Requires-Dist: azure-keyvault-secrets>=4.8; extra == 'all'
Requires-Dist: boto3>=1.34; extra == 'all'
Requires-Dist: hvac>=2.0; extra == 'all'
Requires-Dist: pyyaml>=6.0; extra == 'all'
Provides-Extra: aws
Requires-Dist: boto3>=1.34; extra == 'aws'
Provides-Extra: azure
Requires-Dist: azure-identity>=1.15; extra == 'azure'
Requires-Dist: azure-keyvault-secrets>=4.8; extra == 'azure'
Provides-Extra: dev
Requires-Dist: bandit>=1.7.0; extra == 'dev'
Requires-Dist: mkdocs-material>=9.5; extra == 'dev'
Requires-Dist: pre-commit>=3.0; extra == 'dev'
Requires-Dist: pyrefly>=0.2.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.12; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: pyyaml>=6.0; extra == 'dev'
Requires-Dist: ruff>=0.8.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
Provides-Extra: hashicorp
Requires-Dist: hvac>=2.0; extra == 'hashicorp'
Provides-Extra: precommit
Requires-Dist: pyyaml>=6.0; extra == 'precommit'
Provides-Extra: vault
Requires-Dist: azure-identity>=1.15; extra == 'vault'
Requires-Dist: azure-keyvault-secrets>=4.8; extra == 'vault'
Requires-Dist: boto3>=1.34; extra == 'vault'
Requires-Dist: hvac>=2.0; extra == 'vault'
Description-Content-Type: text/markdown

<p align="center">
  <img src="https://raw.githubusercontent.com/jainal09/envdrift/main/docs/assets/images/env-drift-logo.png" alt="envdrift logo" width="300">
</p>

# envdrift

[![PyPI version](https://badge.fury.io/py/envdrift.svg)](https://badge.fury.io/py/envdrift)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Docs](https://img.shields.io/badge/docs-mkdocs-blue)](https://jainal09.github.io/envdrift)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Pyrefly](https://img.shields.io/badge/types-pyrefly-blue)](https://github.com/facebook/pyrefly)
[![codecov](https://codecov.io/gh/jainal09/envdrift/graph/badge.svg)](https://codecov.io/gh/jainal09/envdrift)
[![SLOC](https://sloc.xyz/github/jainal09/envdrift)](https://sloc.xyz/github/jainal09/envdrift)

**Prevent environment variable drift between dev, staging, and production.**

## The Problem

- A missing `DATABASE_URL` in production causes a 3am outage
- Staging has `NEW_FEATURE_FLAG=true` but production doesn't
- "It works on my machine!" becomes your team's motto

## The Solution

```bash
# Validate .env against Pydantic schema
envdrift validate .env --schema config.settings:Settings

# Compare dev vs prod
envdrift diff .env.development .env.production

# Check encryption status
envdrift encrypt .env.production --check
```

## Installation

```bash
pip install envdrift
```

## Quick Start

**Define your schema:**

```python
from pydantic import Field
from pydantic_settings import BaseSettings, SettingsConfigDict

class Settings(BaseSettings):
    model_config = SettingsConfigDict(extra="forbid")

    DATABASE_URL: str = Field(json_schema_extra={"sensitive": True})
    API_KEY: str = Field(json_schema_extra={"sensitive": True})
    DEBUG: bool = False
```

**Validate:**

```bash
envdrift validate .env --schema config.settings:Settings
```

## Features

| Feature              | envdrift               |
|----------------------|------------------------|
| Schema validation    | Pydantic-based         |
| Cross-env diff       | Yes                    |
| Pre-commit hooks     | Yes                    |
| Encryption (dotenvx) | Yes                    |
| Vault integration    | Azure, AWS, HashiCorp  |
| CI/CD mode           | Yes                    |

## Documentation

Full documentation: **[jainal09.github.io/envdrift](https://jainal09.github.io/envdrift)**

## Development

```bash
git clone https://github.com/jainal09/envdrift.git
cd envdrift
make dev
make test
make docs-serve
```

## License

MIT
