Skip to content

Anvil/kaioretry

Repository files navigation

KaioRetry

PyPI version Supported Python Version License PyPI - Downloads

Pylint Static Quality Github Action Mypy Static Quality Github Action Pylint Static Quality Github Action Documentation Status

KaioRetry is (yet another) retry decorator implementation, which is clearly inspired by the original retry module and is actually backward compatible with it.

Basic usage

Transparently perform retries on failures:

from kaioretry import retry, aioretry


@retry(exceptions=ValueError, tries=2)
def some_func(...):
    ...


@aioretry(exceptions=(ValueError, SomeOtherError), tries=-1, delay=1)
async def some_coroutine(...):
    ...

Documentation

If you care to read more, a more lengthy documentation is available on readthedocs.

Feedback welcome.