waiting
Utility for waiting for stuff to happen
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 waitinguv
uv add waitingpoetry
poetry add waitingInstalling 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
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
busypieProvides expressive, fluent API for…
permissive · top 15,000 on PyPI
wait-for-itA command-line tool that waits for one or more…
permissive · top 15,000 on PyPI
waiterWaiter provides iteration-based retry and…
permissive · top 15,000 on PyPI
polling2Polling2 lets you wait for a function to return…
permissive · top 5,000 on PyPI
retryingRetrying is a decorator-based library that adds…
permissive · top 1,000 on PyPI
python-backoffProvides function decorators for retrying…
permissive · top 5,000 on PyPI
backoffProvides function decorators to automatically…
permissive · top 1,000 on PyPI
httsleephttsleep polls HTTP endpoints repeatedly until…
permissive · top 15,000 on PyPI
wait-for2Provides an alternate implementation of…
permissive · top 15,000 on PyPI
asynckivyAsyncKivy replaces Kivy's callback-based event…
permissive · top 15,000 on PyPI