Skip to main content

A comprehensive Python toolkit for data cleaning and preprocessing

Project description

🚀 Hygiea: Your Data's New Superpower 🧹

Python 3.8+ License: MIT

Tired of wrestling with messy spreadsheets and endless cleaning scripts? Hygiea is a comprehensive Python toolkit that handles EVERYTHING for data cleaning, preprocessing, and analysis.

✨ Why Hygiea?

Stop wasting hours on repetitive data cleaning tasks. Hygiea transforms raw, messy data into clean, model-ready insights in minutes, not hours.

🎯 Key Features

  • 🆔 Standardize: Auto-lowercase and clean column names
  • 🔄 Convert: Detect/convert dates, numeric strings, booleans
  • 💧 Impute: Median/mode, KNN, or MICE imputation
  • ⚖️ Winsorize: Cap outliers via IQR or z-score
  • 🧩 Encode: One-hot, target, or label encoding
  • 📊 EDA: Summary stats, missing-value report, correlation
  • 🌐 Profiling: Interactive HTML reports with one line
  • 🔄 Pipeline-Ready: Drop-in sklearn transformer

🚀 Quick Start

Installation

pip install -e .

Basic Usage

import pandas as pd
import hygiea as hg

# Load your messy data
df = pd.DataFrame({
    'User ID': [1, 2, 3],
    'First Name': ['John', 'Jane', 'Bob'],
    'Annual Income ($)': [50000, None, 75000]
})

# Clean it in one line!
df_clean = hg.clean_data(df)
print(df_clean.columns.tolist())
# Output: ['user_id', 'first_name', 'annual_income']

# Generate beautiful HTML report
hg.profile_data(df, output_file='report.html')

# Get smart cleaning suggestions
suggestions = hg.suggest_cleaning_strategy(df)
print(f"Recommended: {suggestions['recommended_profile']}")

Advanced Pipeline Integration

from sklearn.pipeline import Pipeline
from sklearn.ensemble import RandomForestClassifier
import hygiea as hg

# Seamless sklearn integration
pipeline = Pipeline([
    ('clean', hg.get_transformer()),
    ('model', RandomForestClassifier())
])

# Train with messy data - Hygiea handles the rest!
pipeline.fit(X_train, y_train)
predictions = pipeline.predict(X_test)

📊 Cleaning Profiles

Choose the right cleaning intensity for your data:

# Gentle cleaning (minimal changes)
df_gentle = hg.clean_data(df, profile='gentle')

# Default cleaning (balanced approach)  
df_default = hg.clean_data(df, profile='default')

# Aggressive cleaning (thorough transformation)
df_aggressive = hg.clean_data(df, profile='aggressive')

# Custom cleaning (full control)
custom_config = {
    'standardize_columns': True,
    'convert_types': True,
    'impute': True,
    'handle_outliers': True
}
df_custom = hg.clean_data(df, profile='custom', custom_config=custom_config)

🎛️ Modular Usage

Use individual components for specific tasks:

from hygiea import HygieaStandardizer

# Standardize column names
standardizer = HygieaStandardizer()
df = standardizer.standardize_columns(df)

# Get suggestions without applying
suggestions = standardizer.suggest_column_names(df)
print(suggestions)  # {'Old Name': 'new_name', ...}

🧪 Testing

Run the comprehensive test suite:

python test_hygiea.py

📄 License

MIT License - feel free to use in your projects!

🌟 Show Your Support

If Hygiea saves you time and frustration, please ⭐ star this repo!


🚀 Stop wasting hours on data cleaning!
Turn raw data into model-ready insights in minutes with Hygiea! 🧹✨

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

hygiea-1.0.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

hygiea-1.0.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file hygiea-1.0.0.tar.gz.

File metadata

  • Download URL: hygiea-1.0.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for hygiea-1.0.0.tar.gz
Algorithm Hash digest
SHA256 53c0fb14827d535f490e38cacb14ada4184179ea259e430de6390a61ed9ef253
MD5 34bccc0e85f7cebae01ad94d0dba770c
BLAKE2b-256 265d5b3b4c5cd54470de4e9dd371f91286e76e96222bb40f78083b93fde2ec2f

See more details on using hashes here.

File details

Details for the file hygiea-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: hygiea-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for hygiea-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9ddac3cbf4cac0dbc2a4f73bcd93050ae42c1cfa9ab29f22c0aa1c3bf44cd4b
MD5 4c283a27183d984033df8f4e0f01e8c0
BLAKE2b-256 3682557621d6c276dc9aeea409ab29176459735583f2601823ca9b77dd3b2b67

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