Skip to main content

leopy

Python tools developed by Leo.

Decorators

  • timeout: This decorator can be used to set a timeout for a function. It takes a parameter seconds, which represents the maximum allowed execution time of the function in seconds. If the function execution time exceeds the specified timeout, the decorator raises a TimeoutError exception.

  • rate_limiter: This decorator can be used to limit the call frequency of a function. It takes two parameters: limit, which represents the maximum number of allowed calls within a specified time interval, and interval, which represents the length of the time interval in seconds. If the function is called too frequently, the decorator automatically introduces a delay to meet the rate limiting requirement.

  • stoppable: This decorator can convert a function into a stoppable background thread. It takes an optional parameter sleep_time, which specifies the sleep time between each function execution, defaulting to 1 second. The decorator internally creates a thread event object stop_event to control the stopping of the thread. In a separate thread, the original function is continuously executed in a loop, sleeping according to sleep_time after each execution. By calling the stop function returned by the decorator, the thread execution can be stopped at any time. This decorator is very useful in situations where long-running tasks or dynamic control of task execution is needed.

  • timer: This decorator can be used to measure the execution time of a function. It records the start time of the function execution and then calculates and prints the execution time after the function completes.

  • cache: This decorator can be used to cache the results of a function. If the function has been called with the same arguments before, the decorator directly returns the cached result instead of re-executing the function. This can improve the performance of functions, especially for computationally expensive functions that are frequently called with the same arguments.

  • retry_decorator: This decorator can be used to handle exceptions that may occur during function execution. If the function raises an exception, the decorator automatically retries the function execution until the specified maximum number of retries is reached. There is a certain delay time between each retry.

  • logger: This decorator can be used to log the call information and return value of a function. It prints the function name, arguments, and other information before the function executes, and prints the return value of the function after it executes. This is very helpful for debugging and tracing the function execution process.

Utils

Metadata

Release files for leopy666 0.3.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 leopy666 0.3.0
File Size Uploaded Provenance Actions
leopy666-0.3.0.tar.gz 7.7 kB Without provenance Details for leopy666-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 16.1 kB

Release files / leopy666-0.3.0.tar.gz

Download URL leopy666-0.3.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
554da7e20f37703f9d4a20c54f3aa4ba7b49c5e8fc0d8ed28b27759696ae8612
BLAKE2b-256 checksum
How to use checksums
1185dfeef3e9eb01dbe95929d2fb67ea50da05b82b19418d9c53f71fd1616ee0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.6

Release files / leopy666-0.3.0-py3-none-any.whl

Download URL leopy666-0.3.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef4b25484af01930f1bef6a2b3d5ade45c821adb69467f229f0db4f55ab1c291
BLAKE2b-256 checksum
How to use checksums
9e3399846a83185990b3cdd04a8c8b5d3afc1b9bb6437aced113bccf77d98c85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.6

Security for leopy666 0.3.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