Skip to main content

AI-powered data cleaning library for data scientists

Project description

datapure

AI-powered data cleaning library for data scientists. Clean GB+ files with a single command or a fluent Python API.

Install

pip install datapure

CLI — clean a file in one command

# Basic cleaning
datapure clean sales.csv

# Full options
datapure clean sales.csv \
  --output clean.csv \
  --missing median \
  --outliers iqr \
  --report

# AI-powered cleaning (requires ANTHROPIC_API_KEY)
datapure clean sales.csv --ai

# Profile a file before cleaning
datapure profile sales.csv

# Get AI suggestions without applying
datapure suggest sales.csv

Python API

import pandas as pd
from datapure.core import Pipeline, DataProfiler
from datapure.cleaners import (
    MissingValueCleaner,
    DuplicateCleaner,
    OutlierCleaner,
    SchemaCleaner,
    TextCleaner,
)

df = pd.read_csv("sales.csv")

# Profile first
profiler = DataProfiler()
profile = profiler.run(df)
profiler.print_summary(profile)

# Build and run pipeline
df_clean = (
    Pipeline()
    .add(MissingValueCleaner(strategy="median", col_strategy={"city": "mode"}))
    .add(OutlierCleaner(method="iqr", action="winsorize"))
    .add(DuplicateCleaner(mode="exact"))
    .add(SchemaCleaner(normalize_strings=True))
    .run(df)
)

# Auto-pipeline from profile
pipeline = Pipeline.from_profile(profile)
df_clean = pipeline.run(df)

AI Suggestions

import os
from datapure.ai import AISuggester

os.environ["ANTHROPIC_API_KEY"] = "sk-ant-..."

suggester = AISuggester()
plan = suggester.suggest(df)
plan.print_plan()

pipeline = suggester.build_pipeline(plan, min_confidence=0.8)
df_clean = pipeline.run(df)

Large Files (GB+)

from datapure.io import DataLoader, DataWriter
from datapure.cleaners.polars_missing import PolarsNativeMissingCleaner

# Auto-switches to Polars for files > 100 MB
lf = DataLoader().load("big_file.csv")  # returns pl.LazyFrame

cleaner = PolarsNativeMissingCleaner(strategy="median")
lf_clean = cleaner.clean(lf)

DataWriter().write_polars(lf_clean, "big_file_clean.parquet")

Cleaners

Cleaner What it fixes Key options
MissingValueCleaner Nulls / NaN strategy: median, mean, mode, knn, ffill, constant
DuplicateCleaner Duplicate rows mode: exact, subset, fuzzy
OutlierCleaner Extreme values method: iqr, zscore, isolation_forest
SchemaCleaner Types, dates, emails date_columns, email_columns, bool_columns
TextCleaner Encoding, HTML, whitespace fix_encoding, strip_html, remove_urls

Project structure

datapure/
├── cleaners/      # All 5 cleaners + Polars native cleaner
├── core/          # Pipeline, DataProfiler, ReportGenerator
├── ai/            # Claude API integration
├── io/            # Smart loader and writer
└── cli/           # Click + Rich terminal interface

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

datapure-0.1.0.tar.gz (30.2 kB view details)

Uploaded Source

Built Distribution

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

datapure-0.1.0-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file datapure-0.1.0.tar.gz.

File metadata

  • Download URL: datapure-0.1.0.tar.gz
  • Upload date:
  • Size: 30.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for datapure-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fff0baffc9e65bf813bdddac27f13215cb47ce89f08be36c9f0152eca28b0d52
MD5 fb0ee9f31e2ecb1eddcd732df5cb2e40
BLAKE2b-256 49cc1a66a312d7b769aa74be843bad6cb652614d9440936dc379cfeb27024866

See more details on using hashes here.

File details

Details for the file datapure-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: datapure-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for datapure-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0123d0f0e889e862a3be3ce0e881a517c20e8a9d2a396ea919612c587ed4f23
MD5 bf7839d70b7e0877b236c6dfbebb453b
BLAKE2b-256 2223d4613336c1655134450e15aa39046ae96a85e84daa0d26d7b9aa6e3a0a4f

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