Metadata-Version: 2.4
Name: datacleanr
Version: 0.1.2
Summary: Clean messy real-world datasets with safe, explainable defaults before ML.
Author: Ishwar Soni
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas
Requires-Dist: numpy
Dynamic: license-file

# datacleaner

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

## Installation

```bash
pip install datacleanr
```

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

## Quick Start

```python
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

```python
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

```text
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](LICENSE).
