// the find
litl/backoff
Python library providing function decorators for configurable backoff and retry
A Python decorator library for adding exponential backoff and retry logic to functions. Works with both sync and async code, targeting the common case of flaky network calls and external APIs. Does one thing and does it well.
Supports `backoff.runtime` to read retry delay from response headers like `Retry-After` — that's the right way to handle 429s and most libraries miss it. The `giveup` callable lets you short-circuit retries on 4xx errors without wrapping everything in try/except. Full jitter is the default and follows the AWS guidance correctly. Async support is first-class, not bolted on — coroutines work with the same decorators as sync functions.
CI still references Travis CI which has been effectively dead for open-source for years — signals the project isn't actively maintained (last push May 2024, no commits since). No built-in support for context managers or `with` blocks, so you can't retry a block of code without wrapping it in a function. The event handler dict interface is stringly-typed — you get a plain dict with magic keys rather than a typed dataclass, which is annoying in 2024. No native integration with `tenacity`, which has largely superseded this library and offers a richer feature set for anything beyond basic use.