Skip to main content

Yet another retry implementation.

Project description

retry_toolkit

PyPI - Version PyPI - Python Version Hatch project

(Yet Another) Retry implementation for python.

Do you have code that may be subjected to intermittent failures? Then you should have a retry wapper for it. This module includes a simple retry decorator (factory) you can use. Or peek inside and copy the implementation into your own project where you can make your own tweaks.

No dependencies outside of standard python libraries

Table of Contents

Installation

pip install retry-toolkit

Examples

Defaults to 3 tries, no delays between, retry all exceptions:

from retry.simple import retry

@retry()
def foo():
    some_networking_stuff()

Customize the basic behaviors like so:

from retry.simple import retry

@retry(tries=4, backoff=1, exceptions=SomeConnectionError)
def foo():
    some_other_networking_stuff()

The arguments can take callables for more customization.

License

retry-toolkit is distributed under the terms of the MIT license.

Project details


Download files

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

Source Distribution

retry_toolkit-0.1.1.tar.gz (7.7 kB view hashes)

Uploaded Source

Built Distribution

retry_toolkit-0.1.1-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page