/get-retries

Adding retries to Requests.get() with exponential backoff

Primary LanguagePythonMIT LicenseMIT

This package is no longer maintained.

get_retries Build Status PyPI PyPI - Python Version

Adding retries to Requests.get() with exponential backoff.

Retry unsuccessful GET requests after waiting for a specific time interval. With each unsuccessful request, the time interval increases exponentially (it doubles). The undertaking is declared ultimately unsuccessful when the time interval gets bigger than a maximum backoff value.

Install

pip install get_retries

Usage

import get_retries

# max_backoff: maximum interval to wait in seconds
response = get_retries.get('https://wikipedia.com', max_backoff=32)

if response:
    print(response.status_code)

For more information check out the code.

License

MIT.