Metadata-Version: 2.4
Name: kelvtidy
Version: 0.1.0
Summary: Quick, dependable cleaning for messy CSV/Excel data.
License: MIT
Keywords: data cleaning,pandas,csv,excel,analytics
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=2.0
Requires-Dist: openpyxl>=3.1
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# kelvtidy
![tests](https://github.com/kelv-commits/datatidy/actions/workflows/tests.yml/badge.svg)

Quick, dependable cleaning for messy CSV and Excel data, in one line of Python or one command.

## Why

Real-world spreadsheets are full of inconsistent column names, stray spaces, duplicate rows,
mixed date formats, and currency strings like `$1,200.50` or `(45.10)`. `kelvtidy` fixes these
so you can get to the analysis.

## Install

```bash
pip install git+https://github.com/kelv-commits/datatidy.git
```

## Use in Python

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

df = pd.read_csv("sales.csv")
tidy = clean(df, date_columns=["order_date"], currency_columns=["amount"])
```

Before:

| ` Customer Name ` | Order Date | Amount |
|---|---|---|
| `  Ada   Obi ` | 2026-01-05 | $1,200.50 |
| `Ada Obi` | 2026-01-05 | $1,200.50 |

After:

| customer_name | order_date | amount |
|---|---|---|
| Ada Obi | 2026-01-05 | 1200.5 |

## Use from the command line

```bash
kelvtidy sales.csv -o cleaned.csv --dates order_date --currency amount
```

## What it does

- `clean_columns`: lowercase snake_case column names (handles duplicates)
- `strip_whitespace`: trims and collapses spaces in text cells
- `drop_duplicate_rows`: removes exact duplicates
- `parse_dates`: mixed date formats to real datetimes (bad values become `NaT`)
- `clean_currency`: `$1,200.50`, `₦ 3,000`, `(45.10)`, `1.234,56` to floats
- `clean`: runs everything in order

Column names are normalized first, so pass date/currency columns by their cleaned names.

## Development

```bash
pip install -e ".[dev]"
pytest
```

## Roadmap

- Missing-value strategies
- Phone number and email normalization
- Excel report export

## License

MIT
