{"id":13813772,"url":"https://github.com/kopf/httsleep","last_synced_at":"2025-10-04T09:40:24.703Z","repository":{"id":62569717,"uuid":"64491816","full_name":"kopf/httsleep","owner":"kopf","description":"A python library for polling HTTP endpoints - batteries included!","archived":false,"fork":false,"pushed_at":"2018-11-04T15:19:10.000Z","size":88,"stargazers_count":48,"open_issues_count":4,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-14T05:04:58.980Z","etag":null,"topics":["http","poll","polling","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kopf.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-29T15:42:11.000Z","updated_at":"2024-03-04T21:36:13.000Z","dependencies_parsed_at":"2022-11-03T17:15:31.576Z","dependency_job_id":null,"html_url":"https://github.com/kopf/httsleep","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/kopf/httsleep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopf%2Fhttsleep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopf%2Fhttsleep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopf%2Fhttsleep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopf%2Fhttsleep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kopf","download_url":"https://codeload.github.com/kopf/httsleep/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopf%2Fhttsleep/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270364971,"owners_count":24571423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["http","poll","polling","python"],"created_at":"2024-08-04T04:01:29.725Z","updated_at":"2025-10-04T09:40:19.678Z","avatar_url":"https://github.com/kopf.png","language":"Python","readme":"httsleep\n========\n\n|Build Status|\n\n|Coverage Status|\n\nhttsleep is a powerful polling library for Python.\n\nIdea\n----\n\nSet your success conditions, set a few alarms, and get polling!\n\n::\n\n       until = {\n           'status_code': 200,\n           'jsonpath': [{'expression': 'status', 'value': 'OK'}]\n       }\n       alarms = [\n           {'json': {'status': 'ERROR'}},\n           {'jsonpath': [{'expression': 'status', 'value': 'UNKNOWN'},\n                         {'expression': 'owner', 'value': 'Chris'}],\n           'callback': is_job_really_failing},\n           {'status_code': 404}\n       ]\n       try:\n          response = httsleep(\n              'http://myendpoint/jobs/1', until, alarms=alarms,\n              max_retries=20)\n       except Alarm as e:\n           print \"Response was:\", e.response\n           print \"Alarm condition that matched was:\", e.alarm\n\nTranslated into English, this means:\n\n-  Poll ``http://myendpoint/jobs/1`` -- at most 20 times -- until\n\n   -  it returns a status code of ``200``\n   -  AND the ``status`` key in its response has the value ``OK``\n\n-  but raise an alarm if\n\n   -  the ``status`` key has the value ``ERROR``\n   -  OR the ``status`` key has the value ``UNKNOWN`` AND the ``owner``\n      key has the value ``Chris`` AND the function\n      ``is_job_really_dying`` returns ``True``\n   -  OR the status code is 404\n\nDocumentation\n-------------\n\nhttp://httsleep.readthedocs.io/\n\nInstalling\n----------\n\n::\n\n    pip install httsleep\n\nTesting\n-------\n\n::\n\n    pip install -e .\n    pip install -r test-requirements.txt\n    py.test\n\n.. |Build Status| image:: https://travis-ci.org/kopf/httsleep.svg?branch=master\n   :target: https://travis-ci.org/kopf/httsleep\n.. |Coverage Status| image:: https://coveralls.io/repos/github/kopf/httsleep/badge.svg?branch=master\n   :target: https://coveralls.io/github/kopf/httsleep?branch=master\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopf%2Fhttsleep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkopf%2Fhttsleep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopf%2Fhttsleep/lists"}