--- id: polling2 version: "0.5.0" license: unclear license_treatment: permissive maintenance: aging --- # polling2 — Updated polling utility with many configurable options License: permissive · Maintenance: aging · Downloads: 2.0M/mo ## What it is and what it does Polling2 is a utility for repeatedly calling a function until it returns a desired result or a timeout is reached. Instead of writing custom retry loops with exception handling and timing logic, you pass a callable to polling2.poll() along with timeout and step parameters, and it handles the polling loop for you—returning the function's result when the condition is met or raising an exception if the timeout expires. The package is useful in integration tests, waiting for external resources (files, API responses, locks), and any scenario where you need to retry an operation with configurable delays and timeouts. It's a fork of the original polling library, maintained to address issues the original project no longer handles. Use it for: - Wait for an API endpoint to return a successful status code before proceeding in tests or deployment scripts. - Poll for the existence or non-existence of a file on disk with a timeout to avoid indefinite hangs. - Retry acquiring a resource lock or waiting for a thread to release a lock within a time limit. - Check for completion of an asynchronous background task by polling a status function periodically. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Polling2 lets you wait for a function to return a desired condition without writing custom retry logic, handling timeouts and polling intervals automatically. Yes, if you need a lightweight polling utility. The package has no dependencies, low install friction, and a permissive license. However, note that it is aging—last released in 2021 and not actively developed—so it is best suited for stable, simple polling tasks rather than projects requiring ongoing maintenance or new features. ## Install pip install polling2 uv add polling2 poetry add polling2 ## Installing polling2 Before you install: Low install friction with no runtime dependencies. Maintenance status is aging—last release was 2021-07-19 and the last commit 2026-01-11, so the package is stable but not actively developed. License in practice: Licensed under MIT (permissive), so you can use it freely in commercial and open-source projects with minimal restrictions. Quickstart: pip install polling2 import polling2 file_handle = polling2.poll( lambda: open('/tmp/myfile.txt'), ignore_exceptions=(IOError,), timeout=3, step=0.1 ) Verify before relying: - Whether the package works reliably with modern Python versions (classifiers list Python 2 and 3 but requires_python is unspecified) ## Package facts - License: not declared (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 2.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags polling retry utility, wait for condition function, timeout polling loop, retry with backoff, async polling helper, wait until condition met, polling with timeout, retry-polling, testing-utility [View on SkillFed](https://skillfed.io/packages/polling2) · [View on PyPI](https://pypi.org/project/polling2/)