$npx skillfedfor your agent

timeout-decorator

Timeout decorator

With conditionsPyPI Python ModulesReleased Nov 20204.4M downloads / mopermissive licenseSource build

Decision gist · record as of 2026-08-14

sdist only — timeout-decorator-0.5.0.tar.gz · builds from source
v0.5.0 · released 2020-11-15

Yes, with conditions. The package is simple, permissive, and solves a real problem with minimal overhead. However, it is dormant (last release 2020-11-15) and carries platform and threading constraints: signal-based timeouts are Unix-only and main-thread-only, and multiprocessing timeouts require picklable return values. Install it if you need a lightweight timeout decorator for main-thread code or if you are willing to work around the multiprocessing limitations; avoid it if you need active maintenance or cross-platform signal handling.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Signal-based timeouts (default) only work in the main thread; use use_signals=False for worker threads, but then your function must return picklable objects.
  • High install friction: the package is dormant (last release 2020-11-15, no commits since 2024-01-12) and depends on platform-specific signal handling or multiprocessing, which may require system-level setup or compatibility considerations.

License · maintenance · safety

permissive license (permissive) — MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions, though you must include the license notice.

last release 2020-11-15 (2098 days) · last repo commit 2024-01-12 · 638 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,404,256 downloads/mo, #2,311 on PyPI

Verify before relying

pip install timeout-decorator

import time
import timeout_decorator

@timeout_decorator.timeout(5)
def mytest():
    print("Start")
    for i in range(1, 10):
        time.sleep(1)
        print("{} seconds have passed".format(i))

mytest()
  • Whether the package works reliably with modern Python versions (python_support is unspecified in metadata)
  • Current state of known issues or edge cases beyond the PicklingError fix in 0.3.1
  • Whether signal-based timeouts are reliable across different operating systems
Same gist for agents: .md · .json

What it is and what it does

timeout-decorator is a Python decorator that enforces execution time limits on functions by raising an exception when a function runs longer than a specified duration. It offers two strategies: signal-based timeouts (the default, which works only in the main thread) and multiprocessing-based timeouts (for worker threads and background tasks). The decorator is straightforward to use—you simply annotate a function with @timeout_decorator.timeout(seconds)—and you can customize the exception raised on timeout or switch timeout strategies with a parameter.

The package has been dormant since late 2020, with no active maintenance. It carries no known vulnerabilities and uses a permissive MIT license. The main trade-off is that signal-based timeouts are Unix-specific and thread-constrained, while multiprocessing timeouts require all return values to be picklable, which can be a significant limitation in some applications.

Use it for

  • Wrap long-running API calls or database queries to prevent indefinite hangs in web applications.
  • Enforce time limits on worker thread tasks in background job systems or thread pools.
  • Prevent runaway computations or infinite loops in untrusted or user-provided code.
  • Add timeout protection to legacy functions without refactoring their internals.
  • Limit execution time in test suites to catch performance regressions or deadlocks.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, with conditions.

The package is simple, permissive, and solves a real problem with minimal overhead. However, it is dormant (last release 2020-11-15) and carries platform and threading constraints: signal-based timeouts are Unix-only and main-thread-only, and multiprocessing timeouts require picklable return values. Install it if you need a lightweight timeout decorator for main-thread code or if you are willing to work around the multiprocessing limitations; avoid it if you need active maintenance or cross-platform signal handling.

Install

timeout-decorator on PyPI

Before you install

High install friction: the package is dormant (last release 2020-11-15, no commits since 2024-01-12) and depends on platform-specific signal handling or multiprocessing, which may require system-level setup or compatibility considerations.

Signal-based timeouts (default) only work in the main thread; use use_signals=False for worker threads, but then your function must return picklable objects.

License in practice

MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions, though you must include the license notice.

Quickstart

pip install timeout-decorator

import time
import timeout_decorator

@timeout_decorator.timeout(5)
def mytest():
    print("Start")
    for i in range(1, 10):
        time.sleep(1)
        print("{} seconds have passed".format(i))

mytest()

Verify before relying

  • Whether the package works reliably with modern Python versions (python_support is unspecified in metadata)
  • Current state of known issues or edge cases beyond the PicklingError fix in 0.3.1
  • Whether signal-based timeouts are reliable across different operating systems

Package facts

Licensepermissive license permissive
Python supportNot specified
Install frictionHigh. Source build required
Runtime dependenciesNone
MaintenanceDormant 2,098 days since the last release
Last repo commit
First released
Downloads4,404,256 / month, #2,311 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonTopic :: Software Development :: Libraries :: Python Modules

Evidence: timeout-decorator-0.5.0.tar.gz

Tags

Capabilities
function timeout decoratorlimit execution timetimeout exception handlerfunction execution time limitprevent long-running functionstimeout signal handlermultiprocessing timeout
Topics
execution-controlthreading

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “function timeout decorator”

  • timeout-decoratorA decorator that enforces time limits on function execution, raising…
  • wrapt-timeout-decoratorApplies timeout limits to Python functions and methods via decorator,…
  • func-timeoutRuns any Python function with a specified timeout limit, raising an…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also iterators · retry-decorator · stopit · wrapt-timeout-decorator · func-timeout · inputimeout · retry2 · reretry · pytest-timeout · appnope