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.4.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

pibrary-0.4.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pibrary-0.4.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.16 Linux/6.8.0-1021-azure

File hashes

Hashes for pibrary-0.4.0.tar.gz
Algorithm Hash digest
SHA256 01f4cc0e3b12c819c29d0a49b593c38bfd2a5b4e9f63419fc1a5577134fb875b
MD5 e0c42a41b008215b6d1777f376bbe202
BLAKE2b-256 8835f718178937ff147e27db4f34883984cb3af6eeb8335adc674bbf235de85c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pibrary-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.16 Linux/6.8.0-1021-azure

File hashes

Hashes for pibrary-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14019ad163c50f46cbca7851ce5b87b00f956f926a24fe0959d39e10493d63ac
MD5 8b4e1946bb95062013ff29c7491eaeac
BLAKE2b-256 3efce5855489710c7929372773215645bb9b7eb51669de1c7e2896554e3c7bac

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