Skip to main content

ML dataset quality scanner, scorer, and auto-fixer

Project description

DataReady ๐Ÿงน

ML dataset quality scanner, scorer, and auto-fixer โ€” in 3 lines of code.

PyPI version Python License: MIT


DataReady scans your CSV/DataFrame for 20+ data quality issues, scores it 0โ€“100, and interactively fixes problems โ€” before you train your ML model.

import pandas as pd
from dataready import DataReady

df = pd.read_csv("data.csv")
dr = DataReady(df, target_col="label")
dr.scan()
clean_df = dr.fix()

That's it.


Why DataReady?

Most ML bugs come from dirty data โ€” missing values, ID columns accidentally left in, boolean columns stored as "yes"/"no" strings, outliers that skew your model. DataReady catches all of these before training, not after.


Installation

pip install dataready

Requirements: Python โ‰ฅ 3.9, pandas โ‰ฅ 1.5, numpy โ‰ฅ 1.23


Quick Start

import pandas as pd
from dataready import DataReady

df = pd.read_csv("student_performance.csv")
dr = DataReady(df, target_col="passed")

# 1. Scan โ€” prints a full quality report in the terminal
dr.scan()

# 2. Fix โ€” interactive prompt before each fix
clean_df = dr.fix()

# 3. Or auto-approve all fixes
clean_df = dr.fix(auto_approve=True)

# 4. Export a standalone HTML report
dr.export_report("report.html")

What It Detects

Issue Severity Auto-Fix
Missing values warning / critical โœ… Median / mode imputation, drop if >80% null
Duplicate rows warning / critical โœ… Drop duplicates
Outliers (IQR) warning / critical โœ… Winsorization
High skewness warning / critical โœ… log1p transform
ID / key columns warning โœ… Drop column
Single-value columns critical โœ… Drop column
Near-zero variance warning โœ… Drop column
High cardinality warning โœ… Group rare categories as "Other"
Numeric stored as string warning โœ… Convert to float64
Boolean stored as string info โœ… Convert to bool
Datetime stored as string info โœ… Convert to datetime64
Mixed types in column warning โœ… Cast to string
High correlation (multicollinearity) warning โœ… Drop redundant column
Leading/trailing whitespace info โœ… Strip whitespace
Encoding corruption warning โœ… Remove corrupt characters
Class imbalance warning / critical โŒ Manual (SMOTE / class weights)
Data leakage critical โœ… Drop leaking column

Quality Score

Every dataset gets a 0โ€“100 quality score with a letter grade:

Score Grade Label
100 A+ Perfect โ€” ML-ready
90โ€“99 A Excellent
75โ€“89 B Good โ€” minor issues
60โ€“74 C Fair โ€” needs attention
40โ€“59 D Poor โ€” significant cleaning needed
< 40 F Critical โ€” major work required

Terminal Output Example

============================================================
  DataReady โ€” Dataset Quality Report
============================================================
  Shape   : 500 rows ร— 11 columns
  Issues  : 5 found

  Quality Score
  86.0 / 100  [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘]  Grade: B
  Good โ€” minor issues to address

  [WARNING] โ€” 2 issue(s)
  1. 'parent_education' has 117 missing values (23.4%)
  2. 'student_id' is an ID/key column (500 unique, 100% unique)

  [INFO] โ€” 3 issue(s)
  1. 'internet_access' looks boolean but stored as string
  2. 'extracurricular' looks boolean but stored as string
  3. 'passed' looks boolean but stored as string
============================================================
  5 of 5 issues are auto-fixable. Call .fix() to apply.
============================================================

HTML Report

dr.export_report("report.html")

Opens in any browser. Includes score, grade, all issues, score breakdown, and a column-by-column detail table.


API Reference

dr = DataReady(df, target_col=None, use_color=True)

dr.scan()                        # run checks, print report โ†’ returns self
dr.fix(auto_approve=False)       # interactive or auto fix โ†’ returns clean DataFrame
dr.export_report("report.html")  # save HTML report โ†’ returns path
dr.score()                       # โ†’ dict {score, grade, label, breakdown}
dr.issues()                      # โ†’ list of Issue objects
dr.summary()                     # print one-line summary

target_col

Optional. Enables two extra checks:

  • Class imbalance โ€” is your target unevenly distributed?
  • Data leakage โ€” is any feature suspiciously correlated with the target?

Advanced: scan only specific columns

feature_cols = ["age", "score", "income", "label"]
dr = DataReady(df[feature_cols], target_col="label")

Interactive Fixer

  [1/5] WARNING: 'parent_education' has 117 missing values (23.4%)
  Apply this fix? [y]es / [n]o / [a]ll / [q]uit :
  • y โ€” apply this fix
  • n โ€” skip this fix
  • a โ€” apply this and all remaining fixes
  • q โ€” quit the fixer

Contributing

Pull requests are welcome! To get started:

git clone https://github.com/yourusername/dataready.git
cd dataready
pip install -e ".[dev]"
pytest tests/

Please open an issue first for major changes.


License

MIT ยฉ 2025 โ€” free to use, modify, and distribute.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dataready-0.2.0.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dataready-0.2.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file dataready-0.2.0.tar.gz.

File metadata

  • Download URL: dataready-0.2.0.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for dataready-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e64a5a63d7dcf981280fd416f5a0cb5a57d776c231cfc21ee52b7c099f4c99b7
MD5 3278d39bcd18686641dd092755fb5d76
BLAKE2b-256 f379721195d399e9cbae5c8f3adf0215b944ef5d4552db08940f53a94d99cb6c

See more details on using hashes here.

File details

Details for the file dataready-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dataready-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for dataready-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 004a7c6dbed7ca7244c20b65f2f04b48a63718d511d526ab6f6663b457178d26
MD5 a5d2dca48bd2ad969ac19e297255b876
BLAKE2b-256 f999497c95f9c0f4b319d51643aad2166af47442cea21d54d842ab53db7bd63d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page