Skip to main content

py_simple_timeout_wrap

A simple function execution time limit tool based on concurrent.futures.

Installation

pip install py_simple_timeout_wrap

Usage

from py_simple_timeout_wrap import time_limit
import time

# Set function max execution time to 1 second
@time_limit(1.0)
def task_1():
    time.sleep(0.5)
    return "task_1: done"

# Normal execution within time limit
print(task_1()) # Output: task_1: done

# Set function max execution time to 1 second
@time_limit(1.0)
def task_2():
    time.sleep(1.5)
    return "task_2: done"

# Exceed time limit, throw TimeoutError automatically
print(task_2()) # TimeoutError: function `task_2` time limit exceeded (1s)

Metadata

Release files for py-simple-timeout-wrap 0.1.1

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

Source distribution (sdist)

Source distribution for py-simple-timeout-wrap 0.1.1
File Size Uploaded
py_simple_timeout_wrap-0.1.1.tar.gz 2.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-simple-timeout-wrap 0.1.1
File Interpreter ABI Platform
py_simple_timeout_wrap-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 4.9 kB

Release files / py_simple_timeout_wrap-0.1.1.tar.gz

Download URL py_simple_timeout_wrap-0.1.1.tar.gz
Size 2.0 kB
Tags Source
SHA-256 checksum
How to use checksums
395ee35f71a6f3ad4dad090fdc0c1b8ed6b5ec7728477bcce4f413edbd8f2cd1
BLAKE2b-256 checksum
How to use checksums
070b6a06eff752c474b2b00fe7f24ec04b00dc64a34685abb8c58f782a82ad50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.4 CPython/3.13.12 Windows/11

Release files / py_simple_timeout_wrap-0.1.1-py3-none-any.whl

Download URL py_simple_timeout_wrap-0.1.1-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
864f9414810cdfc9a749674b4a30a32cfa75e8dd9757160c0df146631c09f9bb
BLAKE2b-256 checksum
How to use checksums
bd2ca6168176e685869cd70fc60f328ed3ca51ceba19a0e9d419c1ec3917efd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.4 CPython/3.13.12 Windows/11

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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