A simple greeting module
Project description
PYWRAPTURE
Python utilities and decorators to simplify your code — elegant, readable, and pythonic.
pywrapture is a lightweight module that provides decorators and utility functions for streamlining common Python patterns. It helps make your code cleaner, more readable, and easier to maintain.
This module is particularly useful in production pipelines, testing environments, CLI tooling,
API layers, and any scenario where function behavior needs to be modified, extended,
monitored, or controlled without changing the original function logic.
Features
-
@retryAutomatically retry failed functions a configurable number of times. -
@delayPostpone function execution by a given number of seconds. -
@timerMeasure and report function execution time. -
@handleCatch and log exceptions to a plain-text file. -
@JSONhandleLog exception details (with context) into a structured JSON file. -
Runtime Flags Many decorators expose runtime parameters for greater control (e.g., toggle debug).
-
Utility functions for common patterns
-
Lightweight, no external dependencies
-
Python 3.7+
Installation
pip install pywrapture
Or install from source:
git clone https://github.com/yourusername/pywrapture.git
cd pywrapture
pip install .
Usage
from pywrapture import safe, retry, timed
@retry(attempts=3, delay=1)
def flaky_function():
# Example: network call
...
@delay(seconds=2)
def slow_function():
import time
time.sleep(2)
return "Done"
License
GPL-3.0 License © 2025 Tkemza
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 pywrapture-0.2.0.tar.gz.
File metadata
- Download URL: pywrapture-0.2.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96e97d45b4001be5f093006d155ee49fc764eae1fb4f106453d58450b3d8dbd6
|
|
| MD5 |
5740d505147b961cd2838a10f0bb044b
|
|
| BLAKE2b-256 |
568b943b7d484793508435954ce3af7376140435ed894228ec52b4177bfcd0b4
|
File details
Details for the file pywrapture-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pywrapture-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bc6d519e16eff0b08c0acc3a3cf429d56e2f369c5a4abc4fe8c40b19e28e1cd
|
|
| MD5 |
d002c77aedc46871a73317c270074c33
|
|
| BLAKE2b-256 |
43605c40fae7b07b01201ab63d124221db6a4232de852c4453613c236a223cc8
|