# hynek/stamina

Production-grade retries for Python

Repository: https://github.com/hynek/stamina
Canonical: https://ross.abutalabs.com/products/stamina
Homepage: https://stamina.hynek.me/
Language: Python
License: MIT
License Family: permissive
Topics: retry, python, retrying, reliability
Last push: 2026-08-04T08:14:52+00:00

## Health v2 (maintenance only)
Score: 80/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 96, release rhythm 47, longevity 100
- inputs: {"age_days": 1433, "days_push": 29, "days_rel": 142, "gap_med": 198.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1442, forks 22 (observed 2026-08-28T04:04:44.417355+00:00)

## What it is
stamina is an opinionated Python library for retrying failed operations with production-safe defaults like exponential backoff with jitter, retry limits, and async/Trio support. It wraps Tenacity with a simpler, misuse-resistant API and built-in instrumentation and testing hooks.

## Use cases
- retry failed HTTP requests in Python
- add exponential backoff with jitter to flaky calls
- retry async functions with asyncio or Trio
- limit retries by count and total time
- disable retries globally in tests
- instrument retry attempts with Prometheus or structlog

## When to choose
- you want sensible, opinionated retry defaults without configuring Tenacity by hand
- you need both sync and async retry support with one API
- you want built-in observability and test controls for retries

## When to avoid
- you need highly customized retry policies like custom wait strategies or per-call dynamic tuning
- you're not writing Python
- you prefer full control over retry internals that Tenacity directly provides

## Facets
- artifact type: library
- maturity: stable
- function: error-handling, concurrency, monitoring, testing
- domain: developer-tools, backend, microservices
- platform: python, cross-platform
- tags: retry, backoff, jitter, async, tenacity, resilience, decorator, reliability

## Member repositories
- hynek/stamina (main) score 80

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:44.417355+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-30T04:36:24.188609+00:00, confidence not recorded.
  - readme: https://github.com/hynek/stamina (fetched 2026-08-28T04:04:44.417355+00:00, sha c01644224113)
  - registry_pypi: https://pypi.org/pypi/stamina/json (fetched 2026-08-29T11:47:07.878275+00:00, sha 20a9c5313a78)
- Data as of 2026-08-30T08:39:29.467469+00:00.
