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.0.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.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pythub-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 52f068cfc8a40a621720dedbbcbe0459d9f3e6942db50ddb7411341aef28d5a3
MD5 02837f6f2eefda2c28ad121c9a745779
BLAKE2b-256 4bbfa3615f64475ae4567b910352e5b814f343046c406210efc87886257e8a93

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pythub-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8456753544c70c18c6bb913aced708f46c6395a0db8e519b34866f89078f4448
MD5 eb6877813c87ec99c2b61afc213ef85f
BLAKE2b-256 96ea4fa4e18ca275be9b8e96104d8ae8e67db80a89c730f5402c1fee3676a305

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