{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/4"}],"enrichment":{"capability":"A decorator that enforces time limits on function execution, raising an exception if the function runs longer than a specified number of seconds.","skillfed_tags":["execution-control","threading"],"use_cases":["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."],"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\u2014you simply annotate a function with @timeout_decorator.timeout(seconds)\u2014and you can customize the exception raised on timeout or switch timeout strategies with a parameter.\n\nThe 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.","worth_installing":"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."},"id":"timeout-decorator","links":{"html":"https://skillfed.io/packages/timeout-decorator","md":"https://skillfed.io/packages/timeout-decorator.md","pypi":"https://pypi.org/project/timeout-decorator/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2020-11-15","license_spdx":null,"license_treatment":"permissive","name":"timeout-decorator","python_support":"unspecified","summary":"Timeout decorator"},"popularity":{"monthly_downloads":4404256,"position":2311,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.5.0"}
