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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file data_doctor_lib-0.1.0-py3-none-any.whl.
File metadata
- Download URL: data_doctor_lib-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b93f1086799d3e102457f5b76a074ad1c4d686c17ec94cb140eaccd0cd2d7a9
|
|
| MD5 |
d2c7f211ecb623b97f692c3e42c4949e
|
|
| BLAKE2b-256 |
08c88a7555397a57cd61a75fccad61b60c78dadd8ce0ccf58521863f66233ab1
|