Decorify
Python Library for decorators
Decorify is a lightweight Python library without any dependencies that offers a collection of simple, reusable decorators to enhance your functions. These decorators cover common use cases like logging, timing, retrying, and more.
Installation
Install Decorators via pip:
pip install decorify
Table of Content
| Decorator | Main functionality |
|---|---|
| timeit | Measures the time of the function |
| timeout | Terminates the function after it runs for too long |
| mute | Disables stdout for duration of decorated function |
| validate_typehints | Ensures that typehints are followed, raising error if not |
| retry | If exception is raised function is retried up to predefined amount of times |
| rate_limiter | Limits number of function calls such that there are no function calls within set amount of seconds |
| interval_rate_limiter | Splits time into intervals, and limits the number of function calls within each interval |
| default_value | Set default value for function if exception is raised |
| grid_search | Allow user to perform grid search on each iteration of function call |
| redirect | Enables user to redirect function stdout / stderr |
| crawler | Looks for function calls structure and displays it as a tree or nested lists |
Additional Modules
Iterative
- loop: On each call, function is performed n times and all outputs are returned in a list
- average: Function return mean value of n runs
Plotting (matplotlib)
- plot_multiple: Creates a plot of a function's return values
- plot_single: Creates a plot of a function's return
Contributing
Contributions are welcome! Please submit a pull request or open an issue to add new decorators or suggest improvements.
License
This project is licensed under the Apache v2.0 License.
Metadata
Release files for decorify 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| decorify-0.1.2.tar.gz | 13.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| decorify-0.1.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 29.4 kB
Release files / decorify-0.1.2.tar.gz
| Download URL | decorify-0.1.2.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60a4b58779e8a333d84bee1bc240162314e80860b2493b13cbe342c642e92313
|
|
BLAKE2b-256 checksum How to use checksums |
d0fdc95af076d1445b31a9e9d857f991c00ad249b5f5622a635c217f06525076
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.13.0 Darwin/24.1.0
|
Release files / decorify-0.1.2-py2.py3-none-any.whl
| Download URL | decorify-0.1.2-py2.py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e114b899cf93d5b56df9cfb889613d31f10fb2ec0ec93b68431037041cfefdaa
|
|
BLAKE2b-256 checksum How to use checksums |
eefdb522a779ec4a47c4507a61dd1cf281a2597ee658b7abb118c683dd947c11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.13.0 Darwin/24.1.0
|