skillfed

polling2

Updated polling utility with many configurable options

polling2 v0.5.0 2.0M downloads/30d#3,353 on PyPI61
Permissive license AGING released

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 on this page — 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

polling2 on PyPI

pip

pip install polling2

uv

uv add polling2

poetry

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 not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 1,852 days since the last release
Last repo commit
First released
Downloads 2,028,715/month — #3,353 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: polling2-0.5.0-py2.py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 3

Tags

polling retry utilitywait for condition functiontimeout polling loopretry with backoffasync polling helperwait until condition metpolling with timeout
retry-pollingtesting-utility

More Utilities packages