thombashi / retryrequests

A Python library that make HTTP requests with exponential back-off retry by using requests package.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Python library that make HTTP requests with exponential back-off retry by using requests package.

PyPI package version Supported Python versions
pip install retryrequests

retryrequests has same interface with requests:

Sample Code:
import json

import retryrequests


r = retryrequests.get("https://kctbh9vrtdwd.statuspage.io/api/v2/status.json")
r.raise_for_status()

print(json.dumps(r.json(), indent=4))
Output:
{
    "page": {
        "id": "kctbh9vrtdwd",
        "name": "GitHub",
        "url": "https://www.githubstatus.com",
        "time_zone": "Etc/UTC",
        "updated_at": "2019-03-30T07:11:24.851Z"
    },
    "status": {
        "indicator": "none",
        "description": "All Systems Operational"
    }
}

Python 3.6+

About

A Python library that make HTTP requests with exponential back-off retry by using requests package.

License:MIT License


Languages

Language:Python 90.0%Language:Makefile 10.0%