Skip to main content

Func hooks

Hooks for python functions.

Motivation:

I am developing a system with a microservices architecture and I want to add event hooks to some methods.

However, I don't want to add unrelated code to the busines logic methods. Because this, I developed this package, to be able to add execution points to a particular function.

Example usage:

>>> import func_hooks
>>> @func_hooks.hooks
... def my_func():
...     print("Ran my_func")
...
>>> @my_func.on_before
... def _run_before(invocation):
...     print("Running before my_func.")
...
>>> @my_func.on_after
... def _run_before(invocation_result):
...     print("Running after my_func.")
...
>>> my_func()
Running before my_func.
Ran my_func
Running after my_func.
>>>

Metadata

Release files for func-hooks 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for func-hooks 1.2.0
File Size Uploaded Provenance Actions
func_hooks-1.2.0.tar.gz 5.2 kB Without provenance Details for func_hooks-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for func-hooks 1.2.0
File Interpreter ABI Platform Actions
func_hooks-1.2.0-py3-none-any.whl Python 3 none any Details for func_hooks-1.2.0-py3-none-any.whl

Total release size: 11.7 kB

Release files / func_hooks-1.2.0.tar.gz

Download URL func_hooks-1.2.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3683382dd1ca276622afa044343590c2eedbe0c49202f1c910bd95c3ef46356e
BLAKE2b-256 checksum
How to use checksums
fb6cf669736bddf2349557043ebc0cd3f80b939c67f7ac6bfdda42dd28c5066a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.9 Linux/5.15.79.1-microsoft-standard-WSL2

Release files / func_hooks-1.2.0-py3-none-any.whl

Download URL func_hooks-1.2.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d00c9f8e697f080d5582739e5910b3708c6356756ce68a5c86b682e95f9e869e
BLAKE2b-256 checksum
How to use checksums
3e87588f249f86d0e9c61007556745ddf2be1a7ae2659ad55f5364f5b758e2ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.9 Linux/5.15.79.1-microsoft-standard-WSL2

Security for func-hooks 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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