$npx skillfedfor your agent

timeout-sampler

Timeout utility class to wait for any function output and interact with it in given time

With conditionsPyPI TestingReleased Jul 2026185.0K downloads / moApache-2.0Source build

Decision gist · record as of 2026-08-14

sdist only — timeout_sampler-1.1.2.tar.gz · builds from source
v1.1.2 · released 2026-07-21 · Python >=3.10 · 2 runtime deps: pytest, python-simple-logger

Yes, if you need polling with selective exception handling and timeout-based retry logic. The active maintenance and permissive license are favorable. However, verify whether pytest is a true runtime dependency—if it is, the high install friction may be a concern for lightweight deployments. The minimal community visibility (0 stars) suggests limited real-world validation, so evaluate it in a test environment first.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python >=3.10
  • High install friction due to two runtime dependencies (pytest and python-simple-logger).
  • Active maintenance with a recent release (24 days ago), though the project has minimal community visibility (0 stars).

License · maintenance · safety

Apache-2.0 (permissive) — Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.

last release 2026-07-21 (24 days) · last repo commit 2026-08-13

0 known vulnerabilities (OSV.dev, 2026-08-14) · 184,964 downloads/mo, #10,022 on PyPI

Verify before relying

from timeout_sampler import TimeoutSampler

for sample in TimeoutSampler(
    wait_timeout=60,
    sleep=1,
    func=my_function,
    arg1=value1,
):
    if sample:
        break
  • Whether pytest is truly required at runtime or only for testing (listed as runtime dependency but typically test-only)
  • Performance characteristics when polling high-frequency or long-running functions
  • Behavior and overhead of sensitive-key redaction in logging
Same gist for agents: .md · .json

What it is and what it does

TimeoutSampler is a polling utility that repeatedly calls a function at fixed intervals until it returns a truthy value or a timeout expires. It wraps the function call in a loop, sleeping between attempts, and can be configured to ignore or retry on specific exception types—either all instances of an exception class or only those matching string patterns or callable filters. The package includes a decorator form (@retry) for wrapping functions directly.

The primary use case is waiting for external conditions (SSH connectivity, service availability, async task completion) with fine-grained control over which exceptions should trigger retries versus immediate failure. It logs outcomes (success, failure, timeout) with elapsed time and optional custom labels, and automatically redacts sensitive kwargs like Authorization headers from logs.

Use it for

  • Wait for a service to become available before proceeding with integration tests or deployment scripts
  • Retry API calls with selective exception handling (e.g., retry on 5xx errors but fail immediately on 4xx)
  • Poll for completion of long-running background tasks with a timeout and custom logging
  • Decorate functions to add automatic retry logic with timeout and exception filtering
  • Wait for SSH or network connectivity with detailed logging of connection attempts

Worth the install?

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

With conditions

Yes, if you need polling with selective exception handling and timeout-based retry logic.

The active maintenance and permissive license are favorable. However, verify whether pytest is a true runtime dependency—if it is, the high install friction may be a concern for lightweight deployments. The minimal community visibility (0 stars) suggests limited real-world validation, so evaluate it in a test environment first.

Install

timeout-sampler on PyPI

Before you install

High install friction due to two runtime dependencies (pytest and python-simple-logger). Active maintenance with a recent release (24 days ago), though the project has minimal community visibility (0 stars).

Requires Python >=3.10

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

from timeout_sampler import TimeoutSampler

for sample in TimeoutSampler(
    wait_timeout=60,
    sleep=1,
    func=my_function,
    arg1=value1,
):
    if sample:
        break

Verify before relying

  • Whether pytest is truly required at runtime or only for testing (listed as runtime dependency but typically test-only)
  • Performance characteristics when polling high-frequency or long-running functions
  • Behavior and overhead of sensitive-key redaction in logging

Package facts

LicenseApache-2.0 permissive
Python supportSupports the current Python release >=3.10
Install frictionHigh. Source build required
Runtime dependencies
2 packages
pytestpython-simple-logger
MaintenanceActively maintained 24 days since the last release
Last repo commit
First released
Downloads184,964 / month, #10,022 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Operating System :: OS IndependentProgramming Language :: Python :: 3

Evidence: timeout_sampler-1.1.2.tar.gz

Tags

Capabilities
retry with timeoutpolling function resultswait for condition with timeoutexception handling retry loopfunction polling utilitytimeout-based function sampling
Topics
pollingretry-logictimeout-handling

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 › “retry with timeout”

  • timeout-samplerPolls a function repeatedly within a timeout window, collecting…
  • polling2Polling2 lets you wait for a function to return a desired condition…
  • retry-decoratorProvides a decorator to automatically retry a function when it raises…

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

More Testing packages

pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.

MITpure Python · 3.10+
1.1Bdownloads / mo
virtualenv Worth it
PyPI · Libraries · released Aug 2026

virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.

MITpure Python · 3.9+
532.9Mdownloads / mo
coverage Worth it
PyPI · Testing · released Aug 2026

Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.

Install it if you want to measure test completeness or enforce coverage thresholds in your project.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
pytest-asyncio Worth it
PyPI · Testing · released May 2026

pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.

Install it if you write tests for any asyncio-based code.

Apache-2.0pure Python · 3.10+
275.9Mdownloads / mo
pytest-json-ctrf Worth it
PyPI · Testing · released Jul 2026

A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.

Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.

MITpure Python · 3.8+
273.0Mdownloads / mo

See also inputimeout · polling2 · waiter · retry · python-timeout · reretry · redo · func-timeout · retry2 · waiting