Skip to main content

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

Metadata

Release files for datapure 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datapure 0.1.0
File Size Uploaded
datapure-0.1.0.tar.gz 30.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for datapure 0.1.0
File Interpreter ABI Platform
datapure-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 66.2 kB

Release files / datapure-0.1.0.tar.gz

Download URL datapure-0.1.0.tar.gz
Size 30.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fff0baffc9e65bf813bdddac27f13215cb47ce89f08be36c9f0152eca28b0d52
BLAKE2b-256 checksum
How to use checksums
49cc1a66a312d7b769aa74be843bad6cb652614d9440936dc379cfeb27024866
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / datapure-0.1.0-py3-none-any.whl

Download URL datapure-0.1.0-py3-none-any.whl
Size 36.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0123d0f0e889e862a3be3ce0e881a517c20e8a9d2a396ea919612c587ed4f23
BLAKE2b-256 checksum
How to use checksums
2223d4613336c1655134450e15aa39046ae96a85e84daa0d26d7b9aa6e3a0a4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page