A lightweight and modular Python decorator library
Reason this release was yanked:
Upload bug
Project description
pydeco ๐งฉ
A lightweight and modular Python decorator library that helps you write cleaner and more expressive code.
๐ Features
- ๐ง
@cache: Simple in-memory caching with optional TTL and size limit - ๐
@retry: Automatically retry failed operations with exponential backoff - ๐
@suppress: Suppress exceptions and optionally log them - โฑ๏ธ
@timeit: Time execution of functions - ๐งช
@validate_args: Enforce argument types using runtime validation
๐ฆ Installation
pip install pydeco
๐งโ๐ป Usage
from pydeco import cache, retry
@cache(ttl=60)
def slow_func(x):
return x * x
@retry(times=3, delay=1)
def flaky_api_call():
...
๐ Project Structure
pydeco-main/
โโโ pydeco/
โ โโโ init.py
โ โโโ decorators/
โ โโโ cache.py
โ โโโ retry.py
โ โโโ suppress.py
โ โโโ timeit.py
โ โโโ validate_args.py
โโโ tests/
โ โโโ test_cache.py
โ โโโ test_retry.py
โ โโโ test_suppress.py
โ โโโ test_timeit.py
โ โโโ test_validate_args.py
โโโ README.md
โโโ LICENSE
โโโ setup.py
โโโ pyproject.toml
๐งช Running Tests
pytest pydeco/tests
๐ค Contributing
Pull requests and ideas welcome! Please open an issue or fork and PR.
๐ License
MIT โ see 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
pydecora-1.0.0.tar.gz
(4.8 kB
view details)
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 pydecora-1.0.0.tar.gz.
File metadata
- Download URL: pydecora-1.0.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7959eed54c893a0cb14046e572c418cd6142e86fcd9fb05e13cf92d2631a042d
|
|
| MD5 |
8b9731be859a5db17ed75fbb8af8f6ab
|
|
| BLAKE2b-256 |
6de503d44ceffde36b3b6e08f9e807dc07741802741e6722c02ea1dad8045930
|
File details
Details for the file pydecora-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pydecora-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a36f35a5d5e8ad53010258e201f33a56700f493e64cd4bb05d1acdf0fd10958
|
|
| MD5 |
09461a38e9a8a905bf51ca85e8e3ca3e
|
|
| BLAKE2b-256 |
fb1a30bfffb9a066c280d175db54f7ea7cd08db9c166369f4d1ee4236d9b471f
|