Skip to main content

Intelligent Data Quality Analysis and ML-Assisted Data Cleaning

Project description

SanitiPy

Intelligent data quality analysis and ML-assisted data cleaning for production Python workflows.

SanitiPy is a production-grade Python library built to systematically analyze, validate, score, and improve structured datasets before they enter analytics or machine learning pipelines.

It provides structured profiling, rule-based quality validation, explainable quality scoring, deterministic cleaning utilities, and ML-assisted fix suggestions — all through a single public entry point:

from sanitipy import DataCleaner

🚀 Why SanitiPy?

Modern data systems fail more often due to poor data quality than model limitations.

SanitiPy helps teams:

  • Detect structural issues early
  • Quantify dataset health
  • Enforce quality standards
  • Apply deterministic cleaning safely
  • Receive ML-assisted improvement suggestions
  • Maintain transparency and reproducibility

Designed for:

  • Data Engineers
  • ML Engineers
  • Analytics Teams
  • Data Platform Teams
  • Startups building internal data tooling

🧠 Design Philosophy

SanitiPy follows strict engineering principles:

  • Single public APIDataCleaner
  • No hidden mutations — data is never altered silently
  • ML never auto-applies fixes — human-in-the-loop by design
  • Deterministic-first approach — rules before models
  • Explainable scoring logic
  • Modular architecture
  • Production-ready src layout
  • Test-covered implementation

📦 Core Features (v1.0)

  • Structured dataset profiling (schema-aware)
  • Scalable sampling for large datasets
  • Column-level metadata extraction
  • Rule-based quality validation engine
  • Explainable weighted quality scoring
  • Deterministic cleaning operations
  • ML-assisted fix suggestions (confidence-based)
  • Structured JSON report export
  • Clean, modular architecture

⚙️ Installation

Development Install

pip install -e ".[dev]"

Future PyPI Install

pip install sanitipy

🔍 Quick Example

import pandas as pd
from sanitipy import DataCleaner

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

dc = DataCleaner(df)

# 1. Profile dataset
profile = dc.profile()

# 2. Detect quality issues
issues = dc.check_quality()

# 3. Compute explainable quality score
score = dc.quality_score()

print(score)

📊 Example Output

Quality Issues

[
  {
    "column": "age",
    "rule": "high_missing",
    "severity": "medium",
    "metric": 0.42,
    "threshold": 0.3
  }
]

Quality Score

{
  "score": 72,
  "max_score": 100,
  "penalties": [
    {"rule": "high_missing", "deduction": 20}
  ]
}

Fully transparent. Fully explainable.


🏗 Architecture Overview

SanitiPy uses a modular, production-oriented structure:

sanitipy/
    datacleaner.py   # Public API
    core/            # Profiling, rules, scoring
    cleaning/        # Deterministic cleaning
    ai/              # ML suggestions
    report/          # Structured exports
    utils/           # Validation & helpers

Architectural Principles

  • src/ layout for clean packaging
  • Clear separation of concerns
  • Rule engine abstraction
  • Configurable scoring engine
  • No visualization inside core
  • No notebook dependencies
  • Stable output schemas

🧮 Quality Engine

SanitiPy includes a rule-based validation system:

Built-in rules (v1):

  • High missing rate detection
  • Constant column detection
  • High cardinality detection
  • High duplicate rate detection

The engine is extensible and designed for future plugin support.


🔐 ML-Assisted Suggestions

SanitiPy supports ML-driven fix recommendations.

Key guarantees:

  • Suggestions are confidence-scored
  • Fixes are never auto-applied
  • Users must explicitly approve changes
  • Deterministic cleaning remains primary

🛣 Roadmap

  • Structured profiling engine
  • Rule-based validation engine
  • Weighted scoring engine
  • Deterministic cleaning utilities
  • ML suggestion engine
  • Report exporters (JSON/YAML)
  • Streamlit demo application
  • PyPI release

🧪 Development

Run tests:

pytest

Run with coverage:

pytest --cov=sanitipy --cov-report=term-missing

SanitiPy follows:

  • Test-driven development
  • Modular design
  • Public API stability
  • Semantic commit conventions

🤝 Contributing

Contributions are welcome.

Before submitting a PR:

  • Ensure tests pass
  • Maintain coverage
  • Follow existing architecture patterns
  • Avoid breaking public API
  • Keep changes modular

📜 License

MIT License


🔮 Vision

SanitiPy aims to become a lightweight but powerful data quality foundation layer for modern Python data stacks — sitting between raw ingestion and analytics/ML pipelines.

Transparent. Deterministic. Extensible. Production-ready. "# trigger CI"

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

sanitify-0.1.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

sanitify-0.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sanitify-0.1.0.tar.gz
Algorithm Hash digest
SHA256 664d0cbeeff32d55f3610e24b33ef73b070aa21dba67adfe2f63d770dfb9922a
MD5 126f3316d26cd272422bdbce24641446
BLAKE2b-256 d80e17d8121d284355f86395270a02619875b80905ea1bee979d5e6da45aed21

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for sanitify-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9a7c451080aa3d9f73e0ec6a5d3633491037514b4a6ae2562423323d7d393ab
MD5 32fd19c3f5de43b3f6841ada814faa30
BLAKE2b-256 cd329bbeab717d385118516084ffff637cf4392c1032ab7c8e8c26f23ed7db26

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