skillfed

waiting

Utility for waiting for stuff to happen

waiting v1.5.0 612.7K downloads/30d#5,755 on PyPI
Permissive license BSD 3-Clause License DORMANT released

What it is and what it does

Waiting is a small polling utility that repeatedly calls a predicate function until it returns True, handling timeouts and sleep intervals. It's designed for scenarios where you need to wait for a condition to be satisfied—such as a resource becoming available, a service becoming ready, or a background task completing—without blocking or busy-waiting.

The library supports flexible polling strategies: fixed sleep intervals, exponential backoff with configurable growth rates, and aggregation of multiple predicates using ANY and ALL constructs. It can suppress specific exceptions during polling, invoke a callback after each poll cycle, and provide descriptive timeout messages. With no runtime dependencies and pure-Python implementation, it integrates easily into test suites, integration code, and operational scripts.

Use it for:

  • Test fixtures that wait for a service to become ready before running test cases.
  • Integration code that polls an API or resource until a desired state is reached, with exponential backoff to reduce load.
  • Operational scripts that wait for multiple conditions to be satisfied before proceeding (using ANY or ALL aggregators).
  • Retry logic that waits for transient failures to resolve, ignoring expected exceptions during polling.
  • Monitoring or health-check loops that periodically verify a condition and log progress via on_poll callbacks.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Waiting is a lightweight library for polling a predicate function until it returns True, with support for timeouts, custom sleep intervals, exponential backoff, and aggregation of multiple predicates.

Yes. Waiting is a stable, lightweight utility with no dependencies, permissive licensing, and a clear use case in testing and operational code. The dormant maintenance status is not a concern for a mature, focused library with no known vulnerabilities. Install it if you need straightforward predicate polling with timeout and backoff support.

Install

waiting on PyPI

pip

pip install waiting

uv

uv add waiting

poetry

poetry add waiting

Installing waiting

Before you install

Low friction: pure Python wheel with no runtime dependencies. Dormant maintenance status (716 days since last release), but the package is stable and has been in use since 2011.

License in practice

BSD 3-Clause License is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

from waiting import wait, TimeoutExpired

predicate = lambda: True
result = wait(predicate, timeout_seconds=10)

# With exponential backoff
result = wait(predicate, sleep_seconds=(1, 100))

# Catch timeout
try:
    wait(lambda: False, timeout_seconds=5, waiting_for="something")
except TimeoutExpired:
    pass

Requires Python 3.8 or later.

Verify before relying

  • Whether the package works correctly with flux for simulated timelines (mentioned in description but not detailed).
  • Performance characteristics when polling very frequently or with many predicates aggregated via ANY/ALL.

Package facts

License BSD 3-Clause License (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 716 days since the last release
First released
Downloads 612,683/month — #5,755 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: waiting-1.5.0-py3-none-any.whl

Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

polling predicate functionwait for condition to be truetimeout polling libraryexponential backoff retrywait until predicate satisfiedpolling with timeoutcondition polling utility
pollingtesting-utilityretry-logic

More Utilities packages