Skip to main content

Clean messy real-world datasets with safe, explainable defaults before ML.

Project description

datacleaner

Clean messy real-world datasets before machine learning using safe, explainable defaults.

Installation

pip install datacleanr

PyPI: https://pypi.org/project/datacleanr/

Quick Start

from datacleaner import clean

df = clean(df)

Key Features

  • Missing value handling with high-missing column drop and median/mode fill
  • Duplicate row removal
  • Datatype fixing with safe numeric and datetime conversion
  • Outlier handling with IQR-based cap or remove modes
  • Text standardization for common inconsistencies
  • Feature selection to drop useless columns
  • Correlation-based feature reduction
  • Dataset analysis before cleaning
  • Safety mode to prevent excessive data loss through step rollback

Example Usage

from datacleaner import analyze, clean

analysis = analyze(df)
df_clean, report = clean(df, return_report=True, verbose=True)

print(df.shape, "->", df_clean.shape)
print(report["summary"]["actions_summary"])

This workflow runs a quick pre-cleaning analysis, applies the default cleaning pipeline, and returns a structured report for review.

Why This Library Exists

Messy datasets routinely slow down model development. Teams often repeat similar preprocessing work across projects, and ad-hoc cleaning scripts make behavior inconsistent. datacleaner provides a consistent baseline pipeline with transparent diagnostics so cleaning decisions are easier to review and reuse.

Important Note

  • PyPI package name: datacleanr
  • Python import name: datacleaner

Install with pip using datacleanr, then import in code using datacleaner.

Project Structure

datacleaner/
├── src/datacleaner/
├── examples/
├── README.md
├── pyproject.toml
├── LICENSE
└── .gitignore

Core modules in src/datacleaner include cleaning orchestration, analysis, missing values, duplicates, datatypes, outliers, text standardization, column selection, correlation reduction, and reporting.

Contributing

Pull requests are welcome. Open an issue to discuss bugs, improvements, or proposed changes before large updates.

License

MIT License. See LICENSE.

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

datacleanr-0.1.2.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

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

datacleanr-0.1.2-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file datacleanr-0.1.2.tar.gz.

File metadata

  • Download URL: datacleanr-0.1.2.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for datacleanr-0.1.2.tar.gz
Algorithm Hash digest
SHA256 863e088fba7a51f7a983613e9ff541b51cbe49daa19df5cfc3b4e62cba727de6
MD5 981637577efe792b8d474a2daae7361b
BLAKE2b-256 45fa0772c219e5b2d57bc0f256f0622e13101925a0f43c80c77eab4e710afc00

See more details on using hashes here.

File details

Details for the file datacleanr-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: datacleanr-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for datacleanr-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 29207f8d4630c0129925c554d2393745cbd9be78ecd98d923b7e85fe6823fa41
MD5 9b23cc6ac1d7f900ee3813c07296f892
BLAKE2b-256 3434a5222e383c81a3dfc0e9a348e646b8ede3e5fc07c757e818fcf93ba6cb52

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