Metadata-Version: 2.4
Name: driftwatch
Version: 0.4.0
Summary: Lightweight ML drift monitoring, built for real-world pipelines
Author-email: Your Name <your.email@example.com>
Maintainer-email: Your Name <your.email@example.com>
License: MIT
Project-URL: Homepage, https://github.com/VincentCotella/DriftWatch
Project-URL: Documentation, https://vincentcotella.github.io/DriftWatch/
Project-URL: Repository, https://github.com/VincentCotella/DriftWatch
Project-URL: Issues, https://github.com/VincentCotella/DriftWatch/issues
Project-URL: Changelog, https://github.com/VincentCotella/DriftWatch/blob/main/CHANGELOG.md
Keywords: machine-learning,mlops,drift-detection,monitoring,data-quality,model-monitoring
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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 :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.21.0
Requires-Dist: pandas>=1.3.0
Requires-Dist: scipy>=1.7.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
Requires-Dist: pandas-stubs>=2.0.0; extra == "dev"
Requires-Dist: scikit-learn>=1.0.0; extra == "dev"
Provides-Extra: cli
Requires-Dist: typer>=0.9.0; extra == "cli"
Requires-Dist: rich>=13.0.0; extra == "cli"
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.100.0; extra == "fastapi"
Requires-Dist: uvicorn>=0.23.0; extra == "fastapi"
Provides-Extra: mlflow
Requires-Dist: mlflow>=2.0.0; extra == "mlflow"
Provides-Extra: alerting
Requires-Dist: httpx>=0.24.0; extra == "alerting"
Requires-Dist: aiosmtplib>=2.0.0; extra == "alerting"
Provides-Extra: viz
Requires-Dist: matplotlib>=3.5.0; extra == "viz"
Provides-Extra: all
Requires-Dist: driftwatch[alerting,cli,fastapi,mlflow,viz]; extra == "all"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.5.0; extra == "docs"
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.23.0; extra == "docs"
Dynamic: license-file

# DriftWatch

<div align="center">

**Lightweight ML drift monitoring, built for real-world pipelines**

[![Documentation](https://img.shields.io/badge/docs-vincentcotella.github.io%2FDriftWatch-blue.svg)](https://vincentcotella.github.io/DriftWatch/)
[![CI](https://github.com/VincentCotella/DriftWatch/actions/workflows/ci.yml/badge.svg)](https://github.com/VincentCotella/DriftWatch/actions/workflows/ci.yml)
[![PyPI version](https://badge.fury.io/py/driftwatch.svg)](https://pypi.org/project/driftwatch/)
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

</div>

---

## 📖 Documentation

**Read the full documentation here:** [vincentcotella.github.io/DriftWatch](https://vincentcotella.github.io/DriftWatch/)

## 🚀 Features

- **Multi-Drift Monitoring**:
    - 📊 **Feature Drift**: Monitor input data distribution changes (P(X)).
    - 🎯 **Prediction Drift**: Monitor model output changes (P(Ŷ)).
    - 🧠 **Concept Drift**: Monitor model performance degradation (P(Y|X)).
- **Unified Interface**: `DriftSuite` combines all monitors in one simple API.
- **7 Statistical Detectors**:
    - **PSI**, **KS-Test**, **Wasserstein**, **Jensen-Shannon**, **Anderson-Darling**, **Cramér-von Mises**, **Chi-Squared**.
- **Explainability**: Built-in statistical explanation (`DriftExplainer`) and visualization (`DriftVisualizer`).
- **Production Integrations**:
    - ⚡ **FastAPI** Middleware
    - 📈 **MLflow** Tracking
    - 🔔 **Slack** & **Email** Alerts
- **Lightweight & Robust**: Minimal dependencies, 100% type-safe.

## 📦 Installation

```bash
pip install driftwatch
```

For specific extras:
```bash
pip install driftwatch[viz]     # Visualization support
pip install driftwatch[mlflow]  # MLflow integration
pip install driftwatch[all]     # CLI, API, Alerting, etc.
```

## ⚡ Quick Start

DriftWatch v0.4.0 introduces `DriftSuite` for unified monitoring:

```python
from driftwatch import DriftSuite, DriftType
import pandas as pd

# 1. Initialize suite with reference data (e.g., training set)
suite = DriftSuite(
    reference_data=X_train,
    reference_predictions=y_val_pred,
    task="classification",  # or "regression"
    model_version="v1.0"
)

# 2. Check production batch
report = suite.check(
    production_data=X_prod,
    production_predictions=y_prod_pred
)

# 3. Act on specific drift types
drift_types = report.drift_types_detected()

if DriftType.CONCEPT in drift_types:
    print("🚨 CRITICAL: Concept drift detected — Retrain model!")
elif DriftType.PREDICTION in drift_types:
    print("⚠️ WARNING: Prediction drift — Check model outputs.")
elif DriftType.FEATURE in drift_types:
    print(f"📊 INFO: Feature drift in {report.feature_report.drifted_features()}")
else:
    print("✅ All systems normal.")
```

## 🛠️ Usage Scenarios

| Scenario | Solution |
|----------|----------|
| **Unified Monitoring** | Use `DriftSuite` to track Feature, Prediction, and Concept drift in one go. |
| **Experiment Tracking** | Log all drift metrics to **MLflow** for long-term trend analysis. |
| **Real-time API** | Use `DriftMiddleware` in **FastAPI** to monitor every request. |
| **Alerting** | Send critical alerts via **Slack** or **Email** when model performance degrades. |
| **CI/CD** | Block deployments if `DriftType.PREDICTION` is detected in staging. |

## 📓 Interactive Tutorials

- [**Multi-Drift Tutorial**](examples/notebooks/multi_drift_tutorial.ipynb) — Step-by-step guide to Feature, Prediction, and Concept drift.
- [**Complete Showcase**](examples/notebooks/complete_showcase.ipynb) — Tour of all detectors, visualizers, and integrations.

## 🤝 Contributing

We welcome contributions! Please see our [Contributing Guide](https://vincentcotella.github.io/DriftWatch/contributing/) for details.

1. Fork the repo.
2. Install dev dependencies: `pip install -e ".[dev,all]"`
3. Run tests: `pytest`
4. Submit a PR!

## 📄 License

MIT © [Vincent Cotella](https://github.com/VincentCotella)
