Skip to main content

Automated Data Cleaning Library with a Rust compute backend

Project description

AutomatedCleaning

AutomatedCleaning is a Python library for automated data cleaning, now powered by a Rust compute backend. It preprocesses and analyzes datasets โ€” handling missing values, outliers, spelling corrections, text cleaning, PII masking and more โ€” while the CPU-heavy work runs in compiled Rust for speed and true (GIL-free) parallelism.

Logo


Why Rust + Python?

The library is a hybrid: a friendly Python API on top, a fast Rust engine underneath.

  • ๐Ÿ Python frontend โ€” the API you call, plus everything that leans on the Python ecosystem (Polars I/O, scikit-learn imputation, Plotly dashboards, Presidio PII, Claude AI).
  • ๐Ÿฆ€ Rust backend (automatedcleaning._rustcore) โ€” the number-crunching and per-row string work: text preprocessing, symbol stripping, IQR outliers, skewness, correlation, multicollinearity and JSON detection.

You install one wheel and write normal Python โ€” the Rust is invisible.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ your code โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  import automatedcleaning as ac                                  โ”‚
โ”‚  df = ac.load_data("data.csv"); ac.clean_data(df)                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚ calls
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Python frontend  (automatedcleaning/cleaning.py)                โ”‚
โ”‚    Polars โ€ข scikit-learn โ€ข Plotly โ€ข Presidio โ€ข LangChain         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚ delegates hot loops
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿฆ€ Rust backend  (_rustcore, built with PyO3 + rayon)           โ”‚
โ”‚    text cleaning โ€ข skewness โ€ข IQR โ€ข correlation โ€ข JSON detect     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Benchmark โ€” text preprocessing over 50,000 rows: ~3.8ร— faster than the pure-Python path, with the GIL released so it scales across cores.


Features

  • Supports both large (100+ GB) and small datasets
  • Detects and handles missing values and duplicate records
  • Identifies and corrects spelling errors in categorical values
  • Detects and removes outliers (IQR)
  • Detects and fixes data imbalance
  • Identifies and corrects skewness in numerical data
  • Checks for correlation and detects multicollinearity
  • Analyzes cardinality in categorical columns
  • Identifies and cleans text columns
  • Detects JSON-type columns
  • Detects and masks PII columns
  • Performs univariate, bivariate, and multivariate analysis (interactive dashboard)

Installation

From PyPI (recommended)

pip install AutomatedCleaning

Prebuilt abi3 wheels are published for Linux, macOS and Windows and work on CPython 3.11+ โ€” no Rust toolchain needed to install. The import name is also automatedcleaning (import automatedcleaning as ac).

From source

Building from source requires the Rust toolchain (because the backend is compiled):

# 1. Install Rust (https://rustup.rs) and maturin
pip install maturin

# 2. Clone and build
git clone https://github.com/DataSpoof/AutomatedCleaning.git
cd AutomatedCleaning

# Build & install into the current environment
pip install .

# --- or, for development (needs an active virtualenv) ---
python -m venv .venv && source .venv/bin/activate   # Windows: .venv\Scripts\activate
maturin develop --release

Quick start

import automatedcleaning as ac

# Load any CSV / TSV / JSON / Parquet file (via Polars)
df = ac.load_data("dataset.csv")

# Run the full interactive cleaning pipeline
df_cleaned = ac.clean_data(df, background_image_path="assets/gradient.png")

clean_data() walks the dataset through the whole pipeline and asks a few interactive questions (column spelling fixes, categorical corrections, target column for imbalance). It writes cleaned_data.csv and an EDA dashboard to output/eda/dashboard.html.


Using individual steps

Every stage is also a standalone function you can call directly โ€” useful for scripting or building your own non-interactive pipeline. These delegate to the Rust backend:

import polars as pl
import automatedcleaning as ac

df = ac.load_data("dataset.csv")

df = ac.detect_column_types_and_process_text(df)  # classify + clean text columns (Rust)
df = ac.handle_negative_values(df)                # negatives -> absolute values (Rust)
df = ac.replace_symbols(df)                       # strip $ โ‚น , - โ€ข  (Rust)
df = ac.handle_missing_values(df)                 # KNN impute + mode fill (Python/sklearn)
df = ac.handle_duplicates(df)                     # drop duplicate rows (Polars)
df = ac.remove_outliers(df)                       # IQR outlier removal (Rust)
df = ac.fix_skewness(df)                          # log-transform skewed columns (Rust)
df = ac.check_multicollinearity(df, threshold=0.7)# drop correlated features (Rust)
df, cardinality = ac.check_cardinality(df)        # report + drop constant columns
df = ac.fix_json_columns(df)                      # expand JSON columns (Rust detection)
df = ac.detect_and_mask_pii_polars(df)            # detect + mask PII (Presidio)
ac.generate_dashboard(df)                         # Plotly EDA dashboard
ac.save_cleaned_data(df, "cleaned_data.csv")

Text preprocessing on its own

ac.preprocess_text("I can't wait!! Visit https://x.co @bob ๐Ÿ˜€ it's GR8")
# -> 'cannot wait visit'

Supported file formats

load_data() reads .csv, .tsv, .json, and .parquet (Excel must be converted first).


Requirements

  • Python โ‰ฅ 3.11
  • Key runtime deps (installed automatically): polars, pandas, numpy, pyarrow, nltk, scikit-learn, matplotlib, seaborn, missingno, plotly, pyfiglet, langchain-anthropic, presidio-analyzer, presidio-anonymizer
  • The automatic categorical spell-correction step optionally uses the Anthropic Claude API (you'll be prompted for a key); you can skip it or correct values manually.

Building & contributing

The project uses maturin as its build backend (pyproject.toml). See BUILD.md for the full architecture and build/publish guide.

Cargo.toml            # Rust crate config
src/
  lib.rs              # PyO3 module โ€” functions exposed to Python
  text.rs             # text preprocessing (contractions, regex, stopwords)
  stats.rs            # skewness, IQR, correlation, multicollinearity
automatedcleaning/    # Python frontend package

Cross-platform wheels are built and published to PyPI automatically via GitHub Actions (.github/workflows/CI.yml) on every tagged release (vX.Y.Z).


License

MIT ยฉ Abhishek Kumar Singh / DataSpoof

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

automatedcleaning-1.5.tar.gz (173.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

automatedcleaning-1.5-cp311-abi3-win_amd64.whl (737.3 kB view details)

Uploaded CPython 3.11+Windows x86-64

File details

Details for the file automatedcleaning-1.5.tar.gz.

File metadata

  • Download URL: automatedcleaning-1.5.tar.gz
  • Upload date:
  • Size: 173.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for automatedcleaning-1.5.tar.gz
Algorithm Hash digest
SHA256 97455daaed5bcda7857ec50dcbaab0430d50c5a0d39ffdd66a25202cca00c83a
MD5 04fac10039340c5370e033aefcdaa763
BLAKE2b-256 1c75e95708de902831fba04c1e68ca94bb811c0f2f7c2691f57eee9ced770110

See more details on using hashes here.

File details

Details for the file automatedcleaning-1.5-cp311-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for automatedcleaning-1.5-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 eb0e0832572dbb93f9b59bfafbdc6d09f3d4c3dc2fea615ddbdb72a7f59931d8
MD5 a643d38c21ca2ec687e1e454b6ec9adf
BLAKE2b-256 d4a6a1954eb2d199828c222be62b4ee1be77b583f0f653198a0db8578f50018a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page