Skip to main content

Python3 - Profiler Wrapper

This package provides a wrapper function for easier usage of the built-in profiler.

It only uses builtin modules.

Install

python3 -m pip install profiler_wrapper

See: PyPI

Install

pip install profiler_wrapper

Usage

from profiler_wrapper import profile

def function_to_profile(switch: bool, data: dict, msg: str):
    ...
    return {'data': 'test'}


profile(
    target=function_to_profile,
    args=[True],
    kwargs={
        'data': {'random': 'test'},
        'msg': 'Yesterday is gone.'
    },
    lines=3,
)

# (
#   {'data': 'test'},
#
#   "270011472 function calls (270011215 primitive calls) in 181.830 seconds
#    Ordered by: internal time
#
#    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
#         1    5.000    5.000    8.000    8.000 /tmp/test.py:95(function_to_profile)
#         2    2.000    2.000    3.000    3.000 /tmp/test.py:89(sub_function)
#         3    1.000    1.000    1.000    1.000 /tmp/test.py:89(sub_function2)
#    "
# )

Release files for profile-wrapper 1.0.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 profile-wrapper 1.0.0
File Size Uploaded
profile-wrapper-1.0.0.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for profile-wrapper 1.0.0
File Interpreter ABI Platform
profile_wrapper-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.0 kB

Release files / profile-wrapper-1.0.0.tar.gz

Download URL profile-wrapper-1.0.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9b898ae28c343754a1e2fc9dd7702e2aad8df0606e1d0f0720a05e008e659d35
BLAKE2b-256 checksum
How to use checksums
2158b24dd2581240e6f0dad708f03ce939fc0f41eba8660f16c43d97d20439c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / profile_wrapper-1.0.0-py3-none-any.whl

Download URL profile_wrapper-1.0.0-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f40839e5a3f20c797dce33f7fc692e3b998f33a37ea25336208ae302bfcbbbcd
BLAKE2b-256 checksum
How to use checksums
d71f20092ced3d40f7f689d6270ceff4f4524eab0560f2b36b4c4af6faa5ee9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

1.0.0 This release

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