Skip to main content

timeoutcall

python requires Pepy Total Downlods GitHub repo size PyPI - Version

A package designed to kill a function after a specified amount of time.

Usage

Calling Functions

from timeoutcall import call
from time import sleep

def foo(n):
    time.sleep(n) # raises TimeoutError

# given that `n` is greater than `timeoutSeconds`, an exception will occur
call(target=foo, timeoutSeconds=1, err_msg="error: took too long", n=5)

Decorators

from timeoutcall import timeout
from time import sleep

@timeout(2, "error: took too long")
def foo():
    sleep(3) # will raise TimeoutError

foo()

Package Testing

$ python3 -m timeoutcall.test
$ python3 -m timeoutcall.testcall

Developers

Build and Source Distributions

To build the wheel and source distributions:

  • cd into the repositories root directory
  • run python3 -m build

Metadata

Release files for timeoutcall 1.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 timeoutcall 1.0
File Size Uploaded Provenance
timeoutcall-1.0.tar.gz 4.0 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 8.8 kB

Release files / timeoutcall-1.0.tar.gz

Download URL timeoutcall-1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9b1290f0e278e1a1a9ab0d678d29d5a6ed3a6bf7217705e4bf91cd41c2c94387
BLAKE2b-256 checksum
How to use checksums
5da21f88e274185ce6d12897b2f5553b932081242547cfd9213d31e57b69c288
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / timeoutcall-1.0-py3-none-any.whl

Download URL timeoutcall-1.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9c84a6ec4e2ddbac1ceb525dcc3bece1138026c286924c04df29664d83656bf
BLAKE2b-256 checksum
How to use checksums
ad595a62d41d15d6e8a98b7c25fbd423480d99450c52d9345b2e01b8ccb3538b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Security for timeoutcall 1.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