Skip to main content

Decorify

PyPI - Downloads PyPI Latest Release CI - Test GitHub Pages Documentation

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)

Source distribution for decorify 0.1.2
File Size Uploaded
decorify-0.1.2.tar.gz 13.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for decorify 0.1.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page