httsleep
A python library for polling HTTP endpoints - batteries included!
What it is and what it does
httsleep is a polling library that repeatedly calls an HTTP endpoint until your success conditions are satisfied or an alarm condition fires. You define what success looks like (e.g., status code 200 and a specific JSON field value), set optional alarm conditions that should halt polling early (e.g., a 404 or an error flag in the response), and call the library with a URL and retry limit. It uses jsonpath-rw to match nested JSON fields and requests to make the actual HTTP calls.
The library is designed for scenarios where you need to wait for an asynchronous operation—like a background job or a provisioning task—to complete. You can attach callbacks to alarm conditions to add custom logic. If a success condition is met, you get the response; if an alarm fires, you get an exception with the response and the alarm that triggered it.
Use it for:
- Poll a job-status endpoint until a background task completes or fails, with early exit on error codes
- Wait for a service to become healthy after deployment, checking both HTTP status and response body fields
- Monitor an async operation with custom callbacks that decide whether to treat a response as a real failure
- Test HTTP endpoints in integration tests by polling until expected state is reached or timeout occurs
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
httsleep polls HTTP endpoints repeatedly until a success condition is met or an alarm condition triggers, supporting status code checks, JSON response matching via JSONPath, and custom callbacks.
No. The package is abandoned (last commit 2018-11-04, no activity since). Its classifiers list Python 2.7 through 3.7 support, and compatibility with current Python versions is untested. For new projects, consider a maintained alternative. If you have legacy code already using httsleep, it may still work, but do not adopt it for new work.
Install
httsleep on PyPI
pip
pip install httsleepuv
uv add httsleeppoetry
poetry add httsleepInstalling httsleep
Before you install
Installation is straightforward with low friction—pure Python wheel with only two runtime dependencies. However, the package is abandoned; the last commit was 2018-11-04 and no maintenance has occurred since.
License in practice
Licensed under Apache (permissive), so you can use it freely in commercial and private projects without viral obligations, though you must include a copy of the license.
Quickstart
pip install httsleep
from httsleep import httsleep, Alarm
until = {'status_code': 200, 'jsonpath': [{'expression': 'status', 'value': 'OK'}]}
alarms = [{'status_code': 404}]
try:
response = httsleep('http://myendpoint/jobs/1', until, alarms=alarms, max_retries=20)
except Alarm as e:
print("Alarm matched:", e.alarm)
Verify before relying
- Whether httsleep works reliably on Python versions after 3.7, given the last release predates those versions
- Whether jsonpath-rw and requests dependencies have known security issues or breaking changes since 2018-11-04
Package facts
| License | Apache (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — jsonpath-rw, requests |
| Maintenance | abandoned — 2,840 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 176,893/month — #10,230 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: httsleep-0.3.1-py2.py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 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
waitingWaiting is a lightweight library for polling a…
permissive · top 15,000 on PyPI
busypieProvides expressive, fluent API for…
permissive · top 15,000 on PyPI
http-exceptionsProvides a set of raisable exception classes…
permissive · top 15,000 on PyPI
python-retryProvides a decorator to automatically retry…
permissive · top 15,000 on PyPI
jsonpath-rwParses and executes JSONPath expressions…
permissive · top 5,000 on PyPI
retryhttpRetryhttp wraps HTTP client calls to…
permissive · top 5,000 on PyPI
total-connect-clientA Python client library for authenticating with…
permissive · top 15,000 on PyPI
jsonpath-pythonExtracts, filters, sorts, and updates values in…
permissive · top 1,000 on PyPI