Skip to main content

A simple, user-friendly Python library for basic data cleaning tasks.

Project description

Pyclense

An Object-Oriented, Data Cleaning Toolkit for Python.

Pyclense is a beginner-friendly Python library designed to simplify and automate essential data cleaning tasks. Built with an object-oriented structure, it allows you to clean, transform, and export datasets using reusable, modular components.

Unlike simple script-based solutions, Pyclense uses Inheritance, Polymorphism, and Composition to create a stable and scalable environment for your data cleaning workflows.


Badges

PyPI version
PyPI - Python Version
License: MIT


Key Features

  1. Quick Missing Data Fixer
    Spot and fill in blank or empty values in your dataset. You can replace them with mean, median, mode, or a default value — Pyclense handles the logic for you.

  2. Duplicate Remover
    Easily detect and remove repeated rows or entries. It highlights duplicates and lets you clean them with a single command.

  3. Format Standardizer
    Unify inconsistent formatting in your dataset — such as transforming dates into one format (e.g., MM/DD/YYYY) or removing emojis and special symbols from text fields.

  4. Easy Data Preview and Export
    Preview your data before and after cleaning using built-in table views. Export the cleaned dataset to CSV or Excel, including an auto-generated cleaning summary.


Installation

Install Pyclense via PyPI:

pip install pyclense

From Source

git clone https://github.com/Athea-123/Pyclense.git cd Pyclense pip install -e .


Quick Start: Using the Pipeline

The recommended way to use Pyclense is via the CleaningPipeline orchestrator.

from pyclense.base import BaseCleaner
from pyclense.duplicate import DuplicateCleaner
from pyclense.missing import MissingDataCleaner
from pyclense.pipeline import CleaningPipeline

# 1. Start with the BaseCleaner, loading data from a file
base_cleaner = BaseCleaner("data/dataset.csv")

# 2. Initialize the pipeline with the initial data holder
pipeline = CleaningPipeline(base_cleaner)

# 3. Add cleaning steps (Cleaner classes)
pipeline.add_step(DuplicateCleaner)
pipeline.add_step(MissingDataCleaner)

# 4. Run the pipeline and get the final cleaned BaseCleaner instance
final_result = pipeline.run()

# 5. Save the result
final_result.save_data("data/cleaned_output.csv")

Pyclense uses an object-oriented approach where all specific cleaners inherit from a base class and are managed by a pipeline.

1. BaseCleaner (Parent Class)

The abstract parent class for all cleaners. It provides fundamental functionality and structure:

  • Data Handling: Initializes with either a file path (and loads data automatically) or an existing Pandas DataFrame.
  • Accessors: Provides @property access to the underlying DataFrame (.df).
  • File I/O: Includes methods for loading data (._load_data) and saving the final cleaned DataFrame (.save_data(output_path)).
  • Polymorphism: Enforces that all subclasses must implement the specific cleaning logic in an overridden clean() method.

2. CleaningPipeline (Orchestrator)

The CleaningPipeline is the key for workflow automation using Composition.

  • It accepts an initial BaseCleaner instance (which holds the data).
  • It manages a list of cleaning steps (Cleaner classes) added via add_step().
  • The run() method iterates through the steps, instantiates each cleaner with the current state of the data, executes its clean() method, and updates the data for the next step.

Data Transformers

These modules contain the specific cleaning logic, each overriding the abstract clean() method defined in BaseCleaner.

DuplicateCleaner (duplicate.py): This transformer removes rows that are entirely identical across all columns, ensuring only the first occurrence is kept.

MissingDataCleaner (missing.py): It's responsible for standardizing missing values. This involves replacing both standard pandas NaN values and strings that contain only whitespace (' ') with the standardized string "None".

FormatStandardizer (standardizer.py): This class unifies data formats. Specifically, it standardizes date columns (like 'Review Date') to the MM/DD/YYYY format and removes non-ASCII characters, emojis, or symbols from other text-based columns.


Demos

For more in-depth examples, check out the Jupyter Notebook:

demo.ipynb: Demonstrates the sequential application of DemoCleaner, FormatStandardizer, and MissingDataCleaner on a sample dataset.


Contributors

This project was developed as part of an Object-Oriented Programming course.


Contributing

We welcome contributions from the community to help make Pyclense better! Please feel free to:

  • Report bugs by opening an Issue.
  • Suggest new features or improvements.
  • Submit pull requests with new modules or fixes.
  • Improve the documentation and examples.

Team Members

  • Athea Jane M. Budlong - Lead Developer - GitHub
  • Kate Avancena - Developer - GitHub
  • Belle Margareth Jacobo - Developer - GitHub
  • Sariba Abdula - Developer - GitHub

🤝 Acknowledgments

We thank the following sources and individuals for their contribution and inspiration:

  • Our instructor for guidance and support throughout the development of Pyclense.
  • The established principles of data cleaning found in libraries that inspired our modular, object-oriented design.
  • The general data cleaning community for defining the best practices implemented in our various Cleaner modules.

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.

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

pyclensee-0.1.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

pyclensee-0.1.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file pyclensee-0.1.3.tar.gz.

File metadata

  • Download URL: pyclensee-0.1.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pyclensee-0.1.3.tar.gz
Algorithm Hash digest
SHA256 eb588293df359258456b20d62705e6bac59675dd637f936ff3be73f0e4b6971e
MD5 210ef10f02f6e448dadb13c4c3747401
BLAKE2b-256 bcf23fcd7d71f2f4ccd7c6bfceb479884668ba6135d76d1dc537a0bd2375662c

See more details on using hashes here.

File details

Details for the file pyclensee-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pyclensee-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pyclensee-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b71ba23f5da876221a2b23dc05529f6d103166c0ae65f3ee5fee8d613cf4a264
MD5 baf29948e59de16687df396fb536f450
BLAKE2b-256 2280bebda2ba794d0764f15f2e583a4ffa48ab674a572d31905057172907b47b

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