datacleanx is a fast, CLI-first data cleaning engine for tabular datasets. It's designed for machine learning practitioners and data engineers who want to automate cleaning workflows efficiently using a single command-line interface.
v0.2 — Rust edition The engine has been rewritten in Rust (powered by Polars) for dramatically faster CSV processing.
The original Python implementation is still available for library use; the Rust binary is the recommended way to run the CLI.
- Automates repetitive cleaning steps
- Works out-of-the-box with CSV files
- Outputs timestamped cleaned files and reports
- Docker-ready for CI/CD and containerized workflows
- Includes tests and reports for reproducibility
- Imputation:
mean,median,mode - Encoding:
label,onehot - Outlier removal using IQR
- Feature scaling:
standard,minmax,robust - Auto-saves cleaned data to
outputs/ - Saves reports as structured JSON
- CLI-first design, easily scriptable
- Docker and Poetry integration
python3 -m venv venv
source venv/bin/activate
pip install datacleanx
sudo apt install pipx
pipx ensurepath
pipx install datacleanx
git clone https://github.com/essiebx/datacleanx.git
cd datacleanx
poetry install
poetry run datacleanx sample_input.csv --impute median
If you see an error like externally-managed-environment, avoid using --break-system-packages. Use a venv or pipx as shown above instead.
- Rust toolchain — install with
winget install Rustlang.Rustup(Windows) orcurl https://sh.rustup.rs -sSf | sh(Linux/macOS)
cargo build --release
# Binary: ./target/release/datacleanx (or .exe on Windows)./target/release/datacleanx sample_input.csv --impute median --encode onehot --remove-outliers --scale minmaxThe Rust engine can also be used directly from Python via maturin:
pip install maturin
maturin develop # builds and installs into the current venvThen from Python:
from datacleanx import RustCleaner
cleaner = RustCleaner(
impute_strategy="mean",
encode_categoricals="label",
remove_outliers=False,
scale_numerics="minmax",
)
cleaner.clean_csv("input.csv", "outputs/cleaned.csv")
print(cleaner.report()) # returns a dict
print(cleaner.report_json()) # returns a JSON stringcargo testdatacleanx sample_input.csv --output-name marketing_cleaned --impute mean --scale robust
datacleanx/
├── src/ # Rust source (Rust edition)
│ ├── main.rs # CLI entry point (clap)
│ ├── lib.rs # PyO3 bindings
│ ├── cleaner.rs # Core pipeline orchestrator
│ ├── imputer.rs # Missing value imputation
│ ├── outliers.rs # IQR outlier removal
│ ├── encoder.rs # Label & one-hot encoding
│ ├── scaler.rs # Standard / minmax / robust scaling
│ └── report.rs # JSON report struct
├── tests/
│ ├── integration_test.rs # Rust integration tests
│ ├── test_cleaner.py # Python unit tests
│ └── test_cli.py
├── datacleanx/ # Python source (kept for compatibility)
│ ├── cleaner.py
│ ├── cli.py
│ ├── imputer.py
│ ├── report.py
│ └── __init__.py
├── outputs/ # Auto-saved cleaned CSVs and reports
├── sample_input.csv
├── Cargo.toml # Rust project manifest
├── Dockerfile
├── README.md
└── pyproject.toml
{ "shape_before": [4, 3], "age_imputed_with": "median", "income_imputed_with": "median", "gender_imputed_with": "median", "age_outliers_removed": 1, "income_outliers_removed": 0, "categorical_encoding": "onehot", "scaling": "minmax", "shape_after": [3, 3] }
poetry run pytest
docker build -t datacleanx .
docker run -v $(pwd):/app datacleanx sample_input.csv --impute median --scale standard
PyPI: https://pypi.org/project/datacleanx/
DockerHub: https://hub.docker.com/r/essiebx/datacleanx