Skip to main content

A package of reusable code for ML projects.

Project description

Pibrary

Pibrary framework: A package of reusable code for ML projects

Test Documentation Status Package version Supported Python versions License: MIT

Installation

pip install pibrary

Features

  • File Class: Read and write files in csv, json, and pickle formats.
  • String Class: String manipulation functions.
  • LoguruPro Class: Loguru logger with additional features.
    • Timeit Decorator: Decorator to measure the execution time of a function.
    • Log Table Method: Print a table in the log.

Usage

from pibrary.file import File
from pibrary.loguru import logger
from pibrary.string import String

# File Class
dataframe = File(file_path).read().csv()
File(file_path).write(dataframe).csv()

json_data = File(file_path).read().json()
File(file_path).write(json_data).csv()

pickle_data = File(file_path).read().pickle()
File(file_path).write(pickle_data).csv()

# Logger
@logger.timeit
def some_function(...):
    ...

data = [
    ["Item 1", "Value 1", "Description 1", "Extra 1"],
    ["Item 2", "Value 2", "Description 2", "Extra 2"],
    ["Item 3", "Value 3", "Description 3", "Extra 3"],
    ["Item 4", "Value 4", "Description 4", "Extra 4"],
]
# Log the timing data as a table
logger.log_table(data)

# String Class
new_text = String(text).lower().remove_digits().remove_punctuation().strip()

Documentation

The full documentation of Pibrary is available at https://pibrary.readthedocs.io/en/latest/.

Contributing

Contributions are welcome! Please read CONTRIBUTING for details on how to contribute to this project.

License

This project is licensed under the terms of the MIT license.

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

pibrary-0.3.3.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

pibrary-0.3.3-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file pibrary-0.3.3.tar.gz.

File metadata

  • Download URL: pibrary-0.3.3.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.15 Linux/6.5.0-1025-azure

File hashes

Hashes for pibrary-0.3.3.tar.gz
Algorithm Hash digest
SHA256 2061edc34f679232c8ebd233b7f080e7685944b1fafafd94e0f9499be0a17c2c
MD5 e86685c2a24ab5f81997fc4f5c471b31
BLAKE2b-256 7244c820b153d788c91870590c5205a6bc8ac7a7a4c094e39ac81adce18d8c7d

See more details on using hashes here.

File details

Details for the file pibrary-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: pibrary-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.15 Linux/6.5.0-1025-azure

File hashes

Hashes for pibrary-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b0e0842bfe9593c5331179e216234aa0a6f1d9d56c24f75c458419d406d74b88
MD5 f76949f27c2a4d398c8789197e0e5987
BLAKE2b-256 07073a03de948d30bc9178b77e41e2e50117baab27f53994d97bca677805c18c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page