Skip to main content

Python Performance toolt & utilities

License Pypi Python Versions

In a nutshell Python performance tools is a small library with a set of utilities to help you measure and analyze the performance of your code.

Install

> pip install python-performance-tools

Usage examples

Example 1

# File: example_1.py

import os
import time

from performance_tools import *


def main():
    environment = os.environ.get("ENVIRONMENT", None)

    with catch_time("Example message 2", lambda: environment in ("DEVELOPMENT", "STAGING")):
        for i in range(10):
            time.sleep(1)


if __name__ == '__main__':
    main()

After running the code, you will see:

> python examples/example_1.py
Time: 1.021636976 :: Example message

Example 2

# File: example_2.py

import os
import time

from performance_tools import *


def main():
    environment = os.environ.get("ENVIRONMENT", "STAGING")

    with catch_time("Example message 2", lambda: environment in ("DEVELOPMENT", "STAGING")):
        for i in range(10):
            time.sleep(0.1)


if __name__ == '__main__':
    main()

After running the code, you will see:

> export ENVIRONMENT=DEVELOPMENT
> python examples/example_2.py
Time: 1.035312797 :: Example message 2

License

Dictionary Search is Open Source and available under the MIT.

Contributions

Contributions are very welcome. See CONTRIBUTING.md or skim existing tickets to see where you could help out.

Metadata

Release files for python-performance-tools 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 python-performance-tools 1.0.0
File Size Uploaded Provenance
python-performance-tools-1.0.0.tar.gz 3.4 kB Without provenance Details

Release files / python-performance-tools-1.0.0.tar.gz

Download URL python-performance-tools-1.0.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2ff6b195f55aab1dc554a53b673fa2d88f35a589ba97adad44ba82c86c87b117
BLAKE2b-256 checksum
How to use checksums
dd0075c6d6486d3a7b59006ad8870f30afdd8ae010261325592b96a9b1393f49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for python-performance-tools 1.0.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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file No provenance

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