Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Decorator-based exponential backoff

Project Description

Python Backoff Decorator

This package implements exponential backoff as a decorator. Backoff is
triggered by an exception and is reset when the call is successful.


Apply exponential backoff to any function or method by simply adding the

import backoff
import requests

def send_data(data):'', data={'data': data})

# do something with data that wasn't posted

In the example above calls to `send_data()` will exponentially backoff when
POST is not successful.

Calls During Backoff Period

Any calls made during the backoff period will raise an `InBackoff` exception.

Setting Maximum Backoff

By default the maximum backoff is 1 hour. The `max_backoff` argument can be
passed to change the default; the following will only backoff for 5 minutes:

def send_data(data):'', data={'data': data})

Release History

This version
History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(2.6 kB) Copy SHA256 Hash SHA256
Source None Jan 8, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers