Skip to main content

wrappy

Decorators for common developer utilities in Python 3.6+.

Documentation

Documentation is built with Mkdocs and hosted here.

Quick Examples (see the docs for more detail)

from wrappy import probe, guard, todo, memoize

@probe()
def do_some_heavy_computation(a, b, c):
    return a * b + c

@probe(show_args=True, show_kwargs=True, show_returns=True)
def someone_elses_code():
    # code that does not explain itself
    #
    # show examples of args, kwargs, and return values at runtime to get some clue

@probe(show_caller=5)
def a_call_chain_would_be_nice():
    # find out with show_caller=<number_of_callers_along_the_chain>

@guard(fallback_retval=0)
def this_could_blow_up(a, b):
    return a / b

@todo('Not implemented')
def i_am_not_ready():
    # code is under construction, so throw an error when called prematurely

@guard()
@memoize()
def recursive_or_dynamic_programming_subroutine(n):
    assert isinstance(n, int) and n >= 0
    if n == 0:
        return 0
    return n + recursive_or_dynamic_programming_subroutine(n-1)

Examples by Comparison

This section is under construction!

Release Notes

Metadata

Release files for wrappy 0.2.7

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

Source distribution (sdist)

Source distribution for wrappy 0.2.7
File Size Uploaded Provenance Actions
wrappy-0.2.7.tar.gz 5.6 kB Without provenance Details for wrappy-0.2.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wrappy 0.2.7
File Interpreter ABI Platform Actions
wrappy-0.2.7-py3-none-any.whl Python 3 none any Details for wrappy-0.2.7-py3-none-any.whl

Total release size: 11.4 kB

Release files / wrappy-0.2.7.tar.gz

Download URL wrappy-0.2.7.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
afba2a4c6fc59b19425dd83ec6285984f2fbe5db105a2634a2cf12216844d5a6
BLAKE2b-256 checksum
How to use checksums
92f2378dbc506e0a74dd27d13ae8833e1e6fc89bc65ddd4982e0400a0927466b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.15

Release files / wrappy-0.2.7-py3-none-any.whl

Download URL wrappy-0.2.7-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ba7545c91a9f49df899b588fa45815357f1d8fc8a140d85235514c1320ab401
BLAKE2b-256 checksum
How to use checksums
5627665a9337328efc85c3a832962e8666ae0ff7aaca41b621737fe6d8ae8ead
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.15

Security for wrappy 0.2.7

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