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.
Why autoclean?
Every data science project starts the same way:
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:
from autoclean import clean
df = clean(df)
Installation
pip install autoclean-swapna
Quick Start
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
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
Metadata
Release files for autocleanz 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autocleanz-0.1.0.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autocleanz-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.6 kB
Release files / autocleanz-0.1.0.tar.gz
| Download URL | autocleanz-0.1.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d99b1b2c43d639206584247a80e0a4a915a88d97adc982159d442009129fbbc
|
|
BLAKE2b-256 checksum How to use checksums |
2c86752a78ec4038ecfab10c54d9d51ea5773ae6f2a96ceea137eba7b317075c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / autocleanz-0.1.0-py3-none-any.whl
| Download URL | autocleanz-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e81b6f6b52f1077fa9860871a9023e9210d0b7a591a3b1cff2a8c8b93ef8ee96
|
|
BLAKE2b-256 checksum How to use checksums |
ab2ea18eb5529e3447eb5d076a15630a387a91c8648404ebaaa142e238cb440e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|