A package of reusable code for ML projects
Project description
Pibrary
Pibrary framework: A package of reusable code for ML projects
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pibrary-0.4.1.tar.gz.
File metadata
- Download URL: pibrary-0.4.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
045d9d0ce4dc370ae39153dda5e039dc50c23e3ec32eeb0196636a9a4424b871
|
|
| MD5 |
59b0169abc7b49568efc4225e535e9b6
|
|
| BLAKE2b-256 |
4f6904f82c8da614accff81536847c62d097d34b74c46a8c295ed4be55b7e02c
|
File details
Details for the file pibrary-0.4.1-py3-none-any.whl.
File metadata
- Download URL: pibrary-0.4.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0470f11b10bdedb1c57beb7d7a86491abbdf6ac462f9e092e2ab14638843d84
|
|
| MD5 |
68ccfaeeec5e44f376361046285360a3
|
|
| BLAKE2b-256 |
49371b3f4e8d33f7ba625ca0e4edcc25610e99bf48f66399892510761c50a8c7
|