Metadata-Version: 2.4
Name: autocleanz
Version: 0.1.0
Summary: A Python library for automated data cleaning: column names, duplicates, missing values, outliers, dtypes, and format standardization
Author: Swapna Choudhary
Project-URL: Homepage, https://github.com/swapnachoudhary43/autoclean
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=1.5.0
Dynamic: license-file

# autoclean-swapna

**Stop rewriting the same 10 lines of pandas cleanup in every project.**

`autoclean` is a lightweight Python library that automates the repetitive, boring parts of data cleaning — column names, duplicates, missing values, outliers, inconsistent formats — so you can get straight to analysis.

[![PyPI version](https://img.shields.io/pypi/v/autoclean-swapna)](https://pypi.org/project/autoclean-swapna/)
[![Python versions](https://img.shields.io/pypi/pyversions/autoclean-swapna)](https://pypi.org/project/autoclean-swapna/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

---

## Why autoclean?

Every data science project starts the same way:
```python
df.columns = df.columns.str.lower().str.strip().str.replace(" ", "_")
df = df.drop_duplicates()
df["amount"] = df["amount"].str.replace(",", "").astype(float)
df["date"] = pd.to_datetime(df["date"], errors="coerce")
# ...and five more lines you've written a hundred times before
```

`autoclean` replaces all of that with:
```python
from autoclean import clean
df = clean(df)
```

---

## Installation

```bash
pip install autoclean-swapna
```

---

## Quick Start

```python
import pandas as pd
from autoclean import clean

df = pd.read_csv("messy_data.csv")
df = clean(df)
```

**Before:**
| Customer Name  | Total$Amount |
|---|---|
| Riya | 1,200 |
| Riya | 1,200 |
| Aman | 750 |

**After `clean(df)`:**
| customer_name | totalamount |
|---|---|
| Riya | 1200 |
| Aman | 750 |

Duplicate row dropped, column names normalized, `"1,200"` converted from text to a real number — automatically.

---

## What `clean()` does automatically

| Step | Function |
|---|---|
| Normalizes column names (lowercase, no spaces/symbols) | `fix_column_names` |
| Removes duplicate rows | `remove_duplicates` |
| Converts text-numbers to real numeric types | `fix_dtypes` |

These three are always safe to run automatically — they never discard meaningful data.

## Full function reference

| Function | Description |
|---|---|
| `fix_column_names(df)` | Lowercase, strip whitespace, remove special characters from column names |
| `remove_duplicates(df)` | Drop exact duplicate rows |
| `fix_dtypes(df)` | Convert numeric-looking text columns (e.g. `"1,200"`) into real numbers |
| `report_nulls(df)` | Print a per-column count of missing values |
| `drop_missing(df)` | Drop rows containing any missing values |
| `fill_missing(df)` | Fill missing values — mean for numeric columns, mode for text columns |
| `remove_outliers(df, column)` | Remove statistical outliers using the IQR method |
| `standardize_dates(df, column)` | Parse mixed date formats into one consistent datetime type |
| `standardize_text(df, column)` | Normalize text casing (Title Case) and whitespace |
| `validate_data(df, rules=None)` | Report remaining nulls and check custom value ranges, e.g. `{"age": (0, 120)}` |

These are **opt-in** — call them individually when you need judgment-based cleaning that `clean()` won't do automatically (since they can drop or alter real data).

---

## Full example

```python
from autoclean import fix_column_names, remove_duplicates, fill_missing, remove_outliers, validate_data

df = fix_column_names(df)
df = remove_duplicates(df)
df = fill_missing(df)
df = remove_outliers(df, "amount")

validate_data(df, rules={"age": (0, 120)})
```

---

## Requirements

- Python 3.8+
- pandas >= 1.5.0

## License

MIT © Swapna Choudhary
