Skip to main content

A comprehensive Python library for data preprocessing tasks

Project description

PyTHub

Project Description

PyTHub is a comprehensive Python library designed for data preprocessing tasks. It provides a variety of functions for data cleaning, transformation, and manipulation, making it an essential tool for data engineering projects. The library is built to be publishable on the Python Package Index (PyPI).

Installation

To install PyTHub, use the following command:

pip install pythub

Usage Examples

Here's a brief example of how to use some of the key features of PyTHub:

from pythub import (
    MissingValueHandler,
    OutlierHandler,
    Scaler,
    TextCleaner,
    FeatureEngineer,
    DataTypeConverter,
    CategoricalEncoder,
    DateTimeHandler,
    DataFrameLoader,
    DataSorter,
    DataFrameModifier
)
import pandas as pd

# Load a CSV file into a DataFrame
data = DataFrameLoader.read_csv('synthetic_sample_data.csv')

# Delete rows with missing data in the 'Rating' column
data_1 = MissingValueHandler.delete_missing(data, columns=['Rating'])

# Display the processed DataFrame
print(data_1)

Features

PyTHub includes the following modules and functionalities:

MissingValueHandler: Handle missing values by replacement or deletion. -replace_value(df, value) -impute_mean(df, columns) -impute_median(df, columns) -impute_constant(df, columns, value) -delete_missing(df, columns) -get_rows_with_missing_data(df, column)

OutlierHandler: Detect and handle outliers using the IQR method. -iqr_outliers(df, column, threshold=1.5)

Scaler: Standardize and normalize data. -standard_scale(df, columns) -minmax_scale(df, columns)

TextCleaner: Perform string manipulation and text cleaning. -remove_stopwords(text) -to_lowercase(text) -remove_punctuation(text) -lemmatize(text) -clean_text(text) -clean_columns(df, columns)

FeatureEngineer: Create new features. -create_feature(df, column, func)

DataTypeConverter: Convert data types. -to_numeric(df, columns) -to_categorical(df, columns)

CategoricalEncoder: Encode categorical data. -one_hot_encode(df, columns) -label_encode(df, columns)

DateTimeHandler: Handle date and time data. -to_datetime(df, columns) -extract_date_parts(df, column)

DataFrameLoader: Read data from CSV files. -read_csv(file_path, **kwargs)

DataSorter: Sort DataFrame rows. -sort_by_row(df, column, ascending=True)

DataFrameModifier: Modify DataFrames. -delete_column(df, column)

Dependencies

PyTHub requires the following libraries:

  • re
  • string
  • nltk
  • numpy
  • pandas
  • typing

Authors

  • MHD Alhabeb Alshalah
  • Mohamed Ragab Abdelfattah Abdelfadeel
  • AHMED EMAD ELSAYED MOHAMED ABDELFATTAH

Changelog

Version 1.0.0: Initial release with basic functionalities.

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

pythub-0.1.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

pythub-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file pythub-0.1.1.tar.gz.

File metadata

  • Download URL: pythub-0.1.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.5

File hashes

Hashes for pythub-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c14d621d190b4ded146148cf555f59386afaf5719441c105e084f36936e65d8a
MD5 af6510b9074cd5fa5cba39dce2b469fa
BLAKE2b-256 74e0ec9941ac87e1e0be3e88ce85f08b66ad1caf06353d3678f2ae26965d71e7

See more details on using hashes here.

File details

Details for the file pythub-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pythub-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.5

File hashes

Hashes for pythub-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7c8b961791b2dea24936bfb494c90b4c777446b93201f78bfab0e58306cf40c6
MD5 5d45ef4e8738a41eddab5f947614513a
BLAKE2b-256 e163df663701a4ac30730941ca09bb4f2752d9b7fe3ed9b91112936f2573ee43

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