skillfed

httsleep

A python library for polling HTTP endpoints - batteries included!

httsleep v0.3.1 176.9K downloads/30d#10,230 on PyPI48
Permissive license Apache Abandoned released

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 httsleep

uv

uv add httsleep

poetry

poetry add httsleep

Installing 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

Development Status :: 4 - BetaLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7

Tags

http polling libraryretry with conditionsjsonpath response matchingpolling with alarmshttp endpoint pollingwait for http responseconditional http retry
pollingabandoned

More WWW/HTTP packages