DataShift
DataShift is a dataset versioning and migration framework designed for Machine Learning workflows. Think of it as "Git for Data", allowing you to track changes, compare versions, and manage dataset lifecycles with ease.
Key Features
- Dataset Versioning: Snapshot datasets (CSV, Parquet) and track their evolution over time.
- Diffing: Compare two versions of a dataset to see added/removed rows and schema changes.
- Drift Detection: Guardrails to check for data drift between versions (e.g., row count changes, null distribution).
- Tags & Channels: specific versions with tags (e.g.,
#latest) or moving channels (e.g.,:prod). - Python API & CLI: Flexible usage through a command-line interface or directly within your Python code.
- Experiment Tracking: Link datasets to experiments for reproducibility.
Installation
From Source
pip install .
With Optional Dependencies
For PyTorch integration:
pip install .[torch]
For Parquet support:
pip install .[parquet]
For everything (including dev tools):
pip install .[all]
For Development
pip install -e .[dev]
Quick Start
CLI Usage
-
Initialize DataShift in your project directory:
datashift init -
Snapshot a Dataset:
# Create a version of your customers data datashift snapshot ./data/customers.csv --name customers
-
List Datasets:
datashift list -
Show Dataset Details:
datashift show customers
-
Compare Versions:
# Compare version 1 and version 2 datashift diff customers@v1 customers@v2
-
Checkout a Version:
# Restore a specific version to a file datashift checkout customers@v1 ./restored_customers.csv
-
Drift Check (Guardrails):
# Check if the new version deviates too much from the baseline datashift check customers@v2 --baseline customers@v1 --max-row-change 0.1
Python API Usage
import pandas as pd
from datashift import snapshot_dataset, load, diff_datasets, format_diff_summary
# 1. Snapshot a dataset
result = snapshot_dataset(dataset_name="metrics", source_path="metrics.csv")
print(f"Created version: {result.version}")
# 2. Load a specific version into a DataFrame
df = load("metrics#latest")
print(df.head())
# 3. Diff two versions
diff = diff_datasets("metrics@v1", "metrics@v2")
print(format_diff_summary(diff))
Development
- Clone the repository.
- Install dependencies:
pip install -e .[dev]
- Run tests:
pytest
License
MIT License
Metadata
Release files for hyper-flux-data-shift 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hyper_flux_data_shift-0.1.0.tar.gz | 16.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hyper_flux_data_shift-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.2 kB
Release files / hyper_flux_data_shift-0.1.0.tar.gz
| Download URL | hyper_flux_data_shift-0.1.0.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5be97c68f2aad7a67e569e5ac81abe8aa11dec911934de8cd00085b4f84aae2d
|
|
BLAKE2b-256 checksum How to use checksums |
cb19e511703c9332b4af0f4d179323934471269c53018f0cda3a1be71120e7aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.0 CPython/3.13.3 Windows/11
|
Release files / hyper_flux_data_shift-0.1.0-py3-none-any.whl
| Download URL | hyper_flux_data_shift-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8513ab8ac830e00d9eed60d765cfe6acddea9137c301a84731d4ad257cc3c0f
|
|
BLAKE2b-256 checksum How to use checksums |
c0c11096aaebfdfa7b1dd3c5946efdb91135d5b1447220f570a43ffac04d3e4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.0 CPython/3.13.3 Windows/11
|