Metadata-Version: 2.4
Name: dataclean-kuntal
Version: 0.1.2
Summary: Auto-detect and fix messy data in one function call
Author-email: KUNTALinGITHUB <kuntal.pal7550@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/KUNTALinGITHUB/dataclean
Project-URL: Repository, https://github.com/KUNTALinGITHUB/dataclean
Project-URL: Issues, https://github.com/KUNTALinGITHUB/dataclean/issues
Keywords: data cleaning,pandas,csv,data quality,data science,preprocessing,etl
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=1.3
Requires-Dist: chardet>=4.0
Requires-Dist: rapidfuzz>=3.0
Requires-Dist: python-dateutil>=2.8
Requires-Dist: openpyxl>=3.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# dataclean

> Auto-detect and fix messy data in one function call.

[![PyPI version](https://badge.fury.io/py/dataclean.svg)](https://pypi.org/project/dataclean/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Python](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/)

## Install

```bash
pip install dataclean-kuntal
```

## Quick start

```python
import dataclean as dc

clean_df, report = dc.clean("messy_data.csv")
report.summary()
```

## What it fixes

| Problem | Example | Fix |
|---|---|---|
| Date format chaos | `2024-01-15`, `15/01/2024`, `Jan 15 2024` | Normalized to `YYYY-MM-DD` |
| Hidden nulls | `"N/A"`, `"null"`, `"?"`, `"-"` | Unified to real `NaN` |
| Mixed types | `25`, `"thirty"`, `25.0` | Coerced to dominant type |
| Sneaky duplicates | `John Smith` vs `john smith` | Fuzzy deduplication |
| Encoding errors | `Jos\xef` | Repaired to `José` |
| Inconsistent labels | `"USA"`, `"US"`, `"U.S.A"` | Merged via fuzzy matching |
| Column name mess | `"First Name "`, `"AGE(Years)"` | Normalized to `snake_case` |
| Outliers | `9999999` in salary column | Flagged with context |

## API

```python
import dataclean as dc

# clean any file or DataFrame
clean_df, report = dc.clean("data.csv")
clean_df, report = dc.clean("data.xlsx")
clean_df, report = dc.clean("data.json")
clean_df, report = dc.clean(df)  # existing DataFrame

# use individual fixers
df = dc.fix_columns(df)
df = dc.fix_nulls(df)
df = dc.fix_dates(df)
df = dc.fix_duplicates(df, method="fuzzy")
df = dc.fix_categories(df)
df = dc.flag_outliers(df)

# audit report
report.summary()       # print human-readable summary
report.to_df()         # pandas DataFrame of all changes
report.to_dict()       # list of dicts
report.changes_for("nulls")  # filter by fixer
```

## Options

```python
clean_df, report = dc.clean(
    source="data.csv",
    fix="all",                  # or list: ["columns", "nulls", "dates"]
    output="clean.csv",         # optional save path
    fuzzy_duplicates=True,      # fuzzy deduplication
    outlier_method="iqr",       # "iqr" or "zscore"
    category_threshold=85,      # fuzzy match threshold
    duplicate_threshold=85,     # fuzzy dedup threshold
)
```

## Author

**KUNTALinGITHUB** — Kuntal Pal, Independent Researcher, Kolkata, India

## License

MIT
