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 autoclean-swapna 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 | |
|---|---|---|---|
| autoclean_swapna-0.1.0.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autoclean_swapna-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.7 kB
Release files / autoclean_swapna-0.1.0.tar.gz
| Download URL | autoclean_swapna-0.1.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6abf34dfc717e7332e3f61d0025665ceb2a976b1e9f672e75510c48874e01236
|
|
BLAKE2b-256 checksum How to use checksums |
383be3d627d76ed293f3a26b10f4fb0eb2117f0a443ca769c5164907024f182b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / autoclean_swapna-0.1.0-py3-none-any.whl
| Download URL | autoclean_swapna-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97dceba46c0de6dedc1ad8772716338e8bf88b7599fdd72d185ddc3435ecaced
|
|
BLAKE2b-256 checksum How to use checksums |
84ace29110a30975745d7d87f26ff1f625299bb21e50603894e6db2209f935d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|