busypie
Easy and expressive busy-waiting for Python
What it is and what it does
busypie is a lightweight testing utility that wraps busy-waiting into a readable, fluent API. It's designed specifically for test code where you need to wait for an asynchronous operation or condition to complete—for example, waiting for a user to appear in a database after an async creation call. Instead of writing manual sleep loops or complex synchronization logic, you chain method calls like `wait().at_most(2, SECOND).until(lambda: condition())` to express the intent clearly.
The package has no runtime dependencies and integrates directly into test suites. It's most useful in integration or end-to-end tests where you're verifying that side effects have occurred, rather than in unit tests. The API is inspired by Awaitility (a Java library) and is intended to make test code more readable and maintainable by encoding the wait-and-check pattern in a standard, expressive form.
Use it for:
- Wait for an async database operation to complete in integration tests before asserting on the result.
- Poll for a message to appear in a queue or event stream during end-to-end test scenarios.
- Verify that a background job has finished and updated application state before proceeding with assertions.
- Test event-driven systems where you need to wait for a callback or state change within a timeout.
- Replace manual sleep() calls in test code with explicit, readable timeout-and-condition expressions.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides expressive, fluent API for busy-waiting in tests, allowing you to wait for asynchronous conditions to complete with configurable timeouts and polling.
Yes. busypie is a low-friction, zero-dependency testing utility with active maintenance and no known vulnerabilities. It solves a real problem in async test code—replacing ad-hoc sleep loops with readable, expressive waits. Permissive license and modest but stable adoption make it a safe choice for test suites that need polling logic.
Install
busypie on PyPI
pip
pip install busypieuv
uv add busypiepoetry
poetry add busypieInstalling busypie
Before you install
No runtime dependencies and low install friction. Actively maintained with recent releases; last commit 2026-04-28. Modest but steady adoption at top_15000 tier.
License in practice
Apache License 2.0 (permissive) imposes no significant restrictions on use or redistribution in most contexts.
Quickstart
pip install busypie
from busypie import wait, SECOND
def test_something():
wait().at_most(2, SECOND).until(lambda: condition_is_true())
Requires Python 3.6 or later.
Verify before relying
- Whether the fluent API supports all common polling strategies (fixed delay, exponential backoff, etc.) beyond what the excerpt shows.
- Performance characteristics when polling frequently or with very short timeouts in high-concurrency test scenarios.
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 188 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 216,384/month — #9,380 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: busypie-0.6.1-py3-none-any.whl
Keywords: busy, wait, tdd, test, builder, sleep, pytest
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
waitingWaiting is a lightweight library for polling a…
permissive · top 15,000 on PyPI
polling2Polling2 lets you wait for a function to return…
permissive · top 5,000 on PyPI
waiterWaiter provides iteration-based retry and…
permissive · top 15,000 on PyPI
expectsExpects is an assertion library for TDD/BDD…
permissive · top 15,000 on PyPI
wait-for-itA command-line tool that waits for one or more…
permissive · top 15,000 on PyPI
pytest-raceProvides a pytest fixture that runs test…
permissive · top 15,000 on PyPI
httsleephttsleep polls HTTP endpoints repeatedly until…
permissive · top 15,000 on PyPI
pytest-timeoutAborts pytest tests that exceed a specified…
permissive · top 1,000 on PyPI
pytest-watchRuns pytest continuously, re-executing tests…
permissive · top 5,000 on PyPI
robotframework-seleniumtestabilitySeleniumTestability is a Robot Framework plugin…
permissive · top 15,000 on PyPI