Skip to main content

A Python library for cleaning and preprocessing pandas DataFrames with an optional PyQt GUI

Project description

💊 Data Doctor 💊

Data Doctor is a Python library for cleaning, preprocessing, transforming, and validating pandas DataFrames with an optional PyQt GUI for non-technical users.


Features

  • Data Cleaning

    • Remove duplicates
    • Fill missing values with mean, median, or custom strategies
    • Standardize string columns (trim, lowercase)
    • Email validation
  • Data Transformation

    • Normalize numeric columns
    • Encode categorical variables
  • Validation

    • Check for missing values, duplicates, and column types
  • Pipeline Support

    • Run cleaning, transformation, and validation in a single workflow

Installation

# Clone the repo
git clone https://github.com/noahharshbarger/data-doctor.git
cd data-doctor

# Create virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install package in editable mode with dev dependencies
pip install -e ".[dev]"

Or directly from PyPI:

pip install data-doctor

Usage

import pandas as pd
from data_doctor.cleaner import DataCleaner
from data_doctor.pipeline import DataPipeline

# Example DataFrame
df = pd.DataFrame({
    "name": ["Alice", "Bob", None, "Charlie"],
    "age": [25, None, 30, 22],
    "email": ["alice@test.com", "bob@test.com", "invalid_email", None]
})

# Using DataCleaner
cleaner = DataCleaner(df.copy())
df_cleaned = (cleaner
              .drop_duplicates()
              .fill_missing(strategy="mean")
              .standardize_strings()
              .run_email_validation("email")
              .get_df())

# Using DataPipeline
pipeline = DataPipeline(df.copy())
df_pipeline = (pipeline
               .run_basic_cleaning()
               .run_transformations())
validation_report = pipeline.validate()

print(df_pipeline)
print(validation_report)

Testing

# Run all tests
pytest tests/ 

# Run tests with coverage
pytest --cov=src/data_doctor tests/

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Licensure

MIT License © Noah Harshbarger

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

data_doctor_lib-0.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for data_doctor_lib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b93f1086799d3e102457f5b76a074ad1c4d686c17ec94cb140eaccd0cd2d7a9
MD5 d2c7f211ecb623b97f692c3e42c4949e
BLAKE2b-256 08c88a7555397a57cd61a75fccad61b60c78dadd8ce0ccf58521863f66233ab1

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