pydrifter
An open-source framework to test and monitor ML models and systems.
pydrifter is a lightweight, extensible Python library for detecting data drift between control and treatment datasets using statistical tests.
It is designed for Data Scientists, ML Engineers, and Analysts working with production models and experiments (A/B tests, model monitoring, etc).
🚀 What is pydrifter?
pydrifter provides a unified interface for applying and analyzing statistical tests (e.g., KS-test, Wasserstein distance, PSI, Jensen-Shannon divergence) across multiple features in tabular datasets.
It is useful for:
- A/B testing: Detect whether experiment groups differ significantly.
- Model monitoring: Identify drift in features over time.
- Data quality checks: Validate dataset consistency before training or inference.
🛠️ Features
- 🧪 Plug-and-play statistical test classes with unified API
- 📈 Visualizations for ECDF, KS-test distances, and histograms
- 🧹 Preprocessing config with quantile filtering
- 🧩 Easily extendable with your own test logic
- ✅ Built-in logging, warnings, and tabulated results
📦 Installation
pip install pydrifter
👨💻 Example Usage
import pandas as pd
from pydrifter.config import TableConfig
from pydrifter.calculations import KLDivergence, PSI, Wasserstein
from pydrifter import TableDrifter
data_control = pd.DataFrame({
'age': [25, 30, 35, 40, 45],
'salary': [50000, 60000, 70000, 80000, 90000],
})
data_treatment = pd.DataFrame({
'age': [26, 31, 36, 41, 46],
'salary': [51000, 61000, 71000, 81000, 91000],
})
data_config = TableConfig(numerical=['age', 'salary'], categorical=[])
drifter = TableDrifter(
data_control=data_control,
data_treatment=data_treatment,
data_config=data_config,
tests=[KLDivergence, PSI, Wasserstein]
)
result, summary = drifter.run_statistics(show_result=True)
drifter.draw("age", quantiles=[0.05, 0.95])
👥 Who is it for?
- Data Scientists running experiments or training models
- ML Engineers monitoring pipelines in production
- Analysts working with control/treatment comparisons
📚 Documentation
Soon
📄 License
APACHE License © 2025 Made with ❤️ by Eugene C.
Metadata
Release files for pydrifter 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pydrifter-0.1.8.tar.gz | 19.8 kB | Without provenance | Details for pydrifter-0.1.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydrifter-0.1.8-py3-none-any.whl | Python 3 | none | any | Details for pydrifter-0.1.8-py3-none-any.whl |
Total release size: 46.9 kB
Release files / pydrifter-0.1.8.tar.gz
| Download URL | pydrifter-0.1.8.tar.gz |
|---|---|
| Size | 19.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3615e80b015a9314ccc60ae19a97d985684abc2f163f212d945a79755e5cb50
|
|
BLAKE2b-256 checksum How to use checksums |
6f53e0f85cfdbd422b02b277c983cc4ceb19d3a269e088df1b33ea60b3ef5b84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.12 Darwin/24.0.0
|
Release files / pydrifter-0.1.8-py3-none-any.whl
| Download URL | pydrifter-0.1.8-py3-none-any.whl |
|---|---|
| Size | 27.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d93ead082fd10b61e3251cea1f4fe0380ac0b25ba571b6c3b8f8743948e35f7c
|
|
BLAKE2b-256 checksum How to use checksums |
7cf7d60b5f400d4e56ac384a9edcef3484185c2ec1f6ed58d3c357ec46ad472c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.12 Darwin/24.0.0
|
Security for pydrifter 0.1.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.