--- id: interruptingcow version: "0.8" license: MIT license_treatment: permissive maintenance: abandoned --- # interruptingcow — A watchdog that interrupts long running code. License: permissive · Maintenance: abandoned · Downloads: 169.3K/mo ## What it is and what it does Interruptingcow provides a context manager and decorator to enforce execution timeouts in Python by raising an exception when code runs longer than a specified duration. It uses the operating system's SIGALRM signal to interrupt execution, allowing you to gracefully handle slow operations or infinite loops. The package supports nested timeouts (where inner timeouts can be smaller than outer ones) and quota-based time allocation, letting you share a fixed time budget across multiple invocations. However, it only works on the main thread and cannot coexist with other code that uses SIGALRM signals, making it unsuitable for multi-threaded applications or certain profiling scenarios. Use it for: - Enforce maximum execution time for web request handlers or API endpoints that might hang. - Implement a time budget across multiple loop iterations, falling back to cheaper operations when time runs out. - Wrap potentially infinite or very slow operations in a decorator to prevent them from blocking the entire program. - Create nested timeout scopes where an outer timeout bounds the total runtime of multiple inner operations. - Debug or test code that may hang by catching timeout exceptions and logging diagnostic information. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Interrupts long-running Python code by raising an exception after a specified timeout, using signal-based interruption on the main thread. No. The package is abandoned (last release 2018, no maintenance for 3090 days) with no active support. While it has no known vulnerabilities and the MIT license is permissive, the signal-based approach is fundamentally limited to the main thread and incompatible with modern async patterns. For new projects, use a maintained alternative like `timeout-decorator`, `signal-timeout`, or language-native async timeout mechanisms. ## Install pip install interruptingcow uv add interruptingcow poetry add interruptingcow ## Installing interruptingcow Before you install: High install friction: the package is abandoned (last release 2018-02-27, 3090 days ago) with no recent maintenance signal. No runtime dependencies, but the stale codebase and lack of active support are significant concerns for new projects. 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: from interruptingcow import timeout try: with timeout(5): # slow operation pass except RuntimeError: print('operation timed out') Only works on the main thread; uses SIGALRM signal, so incompatible with code that also uses SIGALRM (including certain profilers). Verify before relying: - Whether the package works reliably on modern Python versions (classifiers list 2.7 and 3.5, but no recent testing reported). - Whether nested timeouts and quota sharing work as documented on current Python releases. - Compatibility with async/await and modern concurrency patterns. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: high - Maintenance: abandoned - Downloads: 169.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags timeout decorator python, interrupt long running code, signal-based timeout, python code execution timeout, watchdog timer, nested timeouts, time quota allocation, signal-based, abandoned [View on SkillFed](https://skillfed.io/packages/interruptingcow) · [View on PyPI](https://pypi.org/project/interruptingcow/)