skillfed

busypie

Easy and expressive busy-waiting for Python

busypie v0.6.1 216.4K downloads/30d#9,380 on PyPI23
Permissive license Apache License 2.0 Active released

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 busypie

uv

uv add busypie

poetry

poetry add busypie

Installing 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

License :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

busy wait testingasync test pollingwait for condition pythontest synchronization helperexpressive timeout waitingtdd polling librarypytest async wait
async-testingtest-utilities

More Testing packages