Skip to main content

# pytoolkitlib 🛠

pytoolkitlib is a lightweight, zero-dependency Python utility toolkit designed to streamline common development tasks such as logging setup, JSON operations, file hashing, and performance benchmarking.

---

## Features

* **LoggerToolkit**: Quick and simple setup for console and file logging.

* **FileToolkit**: Safe reading and writing of JSON files, along with file hash generation (SHA-256, etc.) for integrity checks.

* **BenchmarkToolkit**: Handy decorators to measure execution time of your functions.

* **Zero Dependencies**: Built entirely using Python standard libraries.

---

## Quick Start

### Installation

Install pytoolkitlib via pip:

pip install pytoolkitlib

Usage Examples

1. Setup Logging

from pytoolkitlib import LoggerToolkit



\# Initialize logger with both console and file output

logger = LoggerToolkit.setup\_logger(name="AppLogger", log\_file="app.log")

logger.info("Application started successfully!")

2. Work with JSON & File Hashes

from pytoolkitlib import FileToolkit



data = {"user": "Alice", "role": "admin"}



\# Write JSON safely

FileToolkit.write\_json("config.json", data)



\# Read JSON safely

config = FileToolkit.read\_json("config.json")



\# Generate file SHA-256 hash

file\_hash = FileToolkit.get\_file\_hash("config.json")

print(f"File SHA-256: {file\_hash}")

3. Measure Function Performance

import time

from pytoolkitlib import BenchmarkToolkit



@BenchmarkToolkit.timer

def process\_data():

    time.sleep(1)



\# Calling the function will automatically log its execution time

process\_data()

\# Output: \[Timer] Function 'process\_data' executed in 1.0005 seconds.

License

This project is open-source and available under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytoolkitlib-0.0.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.

pytoolkitlib-0.0.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file pytoolkitlib-0.0.1.tar.gz.

File metadata

  • Download URL: pytoolkitlib-0.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for pytoolkitlib-0.0.1.tar.gz
Algorithm Hash digest
SHA256 581c3522c3ae79a96c26ef9d4dc1d3f388d3448d310c40b9ddd3c9d0fc72f7b1
MD5 447a757b38ad384f3798001ac27d487c
BLAKE2b-256 272e089bda84bbd80c4ef92151bb5a0fb9cfc7c743ef847bb8de05deb33b8157

See more details on using hashes here.

File details

Details for the file pytoolkitlib-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pytoolkitlib-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for pytoolkitlib-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 43561876b4d9031423b4649449fdc52ed5ea6ebdfc0aa5804fb0e6186f2fa943
MD5 65db5ea5d8e3a0766305a62034aa8a5b
BLAKE2b-256 4fa08f7aa82576633c22214ad69e62e73dbb2db5421a3586290ea42f4d57d7e2

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 Sentry Error logging StatusPage Status page