A lightweight decorator for automatic exception handling and logging in Python.
Project description
🧰 ThrowPy
ThrowPy is a lightweight Python library that provides a simple and elegant way to make any function or class method "throwable", similar to Java-style exception handling.
It offers an easy-to-use decorator — @ThrowableExcept — that automatically catches exceptions, prints meaningful error messages, and optionally logs them to a file.
🚀 Features
- 🔹 Simple decorator-based usage
- 🔹 Automatic exception catching with file and line context
- 🔹 Optional file logging (
logErr=True) - 🔹 Works with both functions and class methods
- 🔹 Minimal dependencies (pure Python)
- 🔹 Python 3.8+ compatible
📦 Installation
You can install ThrowPy directly from PyPI:
pip install throwpy
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
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 throwpy-1.0.2.tar.gz.
File metadata
- Download URL: throwpy-1.0.2.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
009244cf0c089ee8baecc6d4e78ee835a3c3919be5b52542135d1159c91c49a8
|
|
| MD5 |
2212886b2ac34d370b7ca89515da69ad
|
|
| BLAKE2b-256 |
f819d751eb0016aa8b425b757265e1a6355ea314a077057fc01bb9b60416787b
|
File details
Details for the file throwpy-1.0.2-py3-none-any.whl.
File metadata
- Download URL: throwpy-1.0.2-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
452572ee3cf069ea0f737c8f3a1de3fc9fea7b27ee03c1cffcf2d7b385343a72
|
|
| MD5 |
e02e2fe6006fd7e61db7820e3e9b3f70
|
|
| BLAKE2b-256 |
21c6ae3d4f8be940bef99ad6ef5fe020fe5aff9b92846be37deced039e368a14
|