Skip to main content

A simple greeting module

Project description

logo

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

  • @retry Automatically retry failed functions a configurable number of times.

  • @delay Postpone function execution by a given number of seconds.

  • @timer Measure and report function execution time.

  • @handle Catch and log exceptions to a plain-text file.

  • @JSONhandle Log 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


Download files

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

Source Distribution

pywrapture-0.2.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

pywrapture-0.2.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for pywrapture-0.2.0.tar.gz
Algorithm Hash digest
SHA256 96e97d45b4001be5f093006d155ee49fc764eae1fb4f106453d58450b3d8dbd6
MD5 5740d505147b961cd2838a10f0bb044b
BLAKE2b-256 568b943b7d484793508435954ce3af7376140435ed894228ec52b4177bfcd0b4

See more details on using hashes here.

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

Hashes for pywrapture-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bc6d519e16eff0b08c0acc3a3cf429d56e2f369c5a4abc4fe8c40b19e28e1cd
MD5 d002c77aedc46871a73317c270074c33
BLAKE2b-256 43605c40fae7b07b01201ab63d124221db6a4232de852c4453613c236a223cc8

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