# jd/tenacity

Retrying library for Python

Repository: https://github.com/jd/tenacity
Canonical: https://ross.abutalabs.com/products/tenacity
Homepage: http://tenacity.readthedocs.io
Language: Python
License: Apache-2.0
License Family: permissive
Topics: python, failure, retry, retry-library, hacktoberfest
Last push: 2026-08-06T06:51:35+00:00

## Health v2 (maintenance only)
Score: 88/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 96, release rhythm 72, longevity 100
- inputs: {"age_days": 3674, "days_push": 27, "days_rel": 28, "gap_med": 90.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 8764, forks 346 (observed 2026-08-28T04:10:25.632873+00:00)

## What it is
Tenacity is a general-purpose retrying library for Python that simplifies adding retry behavior to functions and code blocks. It supports configurable stop conditions, wait/backoff strategies, retrying on exceptions or result values, coroutines, and a context manager.

## Use cases
- retry flaky network requests until they succeed
- add exponential backoff to API calls
- retry a function a limited number of attempts before giving up
- retry async coroutines on exceptions
- retry only specific exception types
- retry until a function returns an expected value

## When to choose
- you need robust, configurable retry logic with backoff in Python
- you want a decorator-based API for retrying functions or coroutines
- you are migrating from the unmaintained retrying library

## When to avoid
- you need distributed or cross-service retry coordination
- you want retries managed by infrastructure like a message queue or service mesh
- your use case is simple enough for a hand-written loop

## Facets
- artifact type: library
- maturity: stable
- function: error-handling, concurrency
- domain: developer-tools
- platform: python
- tags: retry, backoff, decorator, resilience, automation

## Member repositories
- jd/tenacity (main) score 88

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:25.632873+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:25:14.749183+00:00, confidence not recorded.
  - readme: https://github.com/jd/tenacity (fetched 2026-08-28T04:10:25.632873+00:00, sha 1e3ed06e90fe)
  - homepage: http://tenacity.readthedocs.io (fetched 2026-08-29T08:25:31.472006+00:00, sha 4d62568f817f)
  - registry_pypi: https://pypi.org/pypi/tenacity/json (fetched 2026-08-29T08:25:31.481691+00:00, sha 9d9bf34c411a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
