$npx skillfedfor your agent

tenacity

Retry code until it succeeds

Worth itPyPI UtilitiesReleased Feb 2026429.3M downloads / moApache 2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — tenacity-9.1.4-py3-none-any.whl
v9.1.4 · released 2026-02-07 · Python >=3.10

Yes. Tenacity is a mature, actively maintained library in the top 100 PyPI packages with no known vulnerabilities, zero runtime dependencies, and permissive licensing. It solves a common problem (adding retry logic) with a clean API and is suitable for production use.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later.
  • Low install friction with no runtime dependencies.
  • Active maintenance with recent releases and 8746 repository stars.

License · maintenance · safety

Apache 2.0 (permissive) — Apache 2.0 permissive license allows use in commercial and proprietary projects with minimal restrictions.

last release 2026-02-07 (188 days) · last repo commit 2026-08-06 · 8,746 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 429,288,446 downloads/mo, #98 on PyPI

Verify before relying

pip install tenacity

from tenacity import retry, stop_after_attempt

@retry(stop=stop_after_attempt(3))
def do_something():
    # function body
    pass
Same gist for agents: .md · .json

What it is and what it does

Tenacity is a general-purpose retry library that simplifies adding retry behavior to functions and code blocks in Python. It originated as a maintained fork of an unmaintained library and provides a decorator-based API to automatically retry functions when exceptions occur or specific conditions are met.

The library supports flexible retry strategies including configurable stop conditions (attempt limits, time limits), wait strategies (fixed delays, exponential backoff, jitter, chained backoffs), and fine-grained control over which exceptions or return values trigger retries. It works with regular functions, coroutines, and context managers, making it applicable across synchronous and asynchronous code patterns.

Use it for

  • Retry flaky network requests or API calls with exponential backoff to handle transient failures.
  • Implement resilience in distributed systems by retrying remote service calls with configurable delays.
  • Handle database connection timeouts or temporary unavailability with bounded retry attempts.
  • Add retry logic to file I/O operations that may fail due to temporary resource contention.
  • Build fault-tolerant batch jobs that retry individual task failures before giving up.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

Tenacity is a mature, actively maintained library in the top 100 PyPI packages with no known vulnerabilities, zero runtime dependencies, and permissive licensing. It solves a common problem (adding retry logic) with a clean API and is suitable for production use.

Install

tenacity on PyPI

Before you install

Low install friction with no runtime dependencies. Active maintenance with recent releases and 8746 repository stars. Supports current Python versions (3.10 through 3.14).

Requires Python 3.10 or later.

License in practice

Apache 2.0 permissive license allows use in commercial and proprietary projects with minimal restrictions.

Quickstart

pip install tenacity

from tenacity import retry, stop_after_attempt

@retry(stop=stop_after_attempt(3))
def do_something():
    # function body
    pass

Package facts

LicenseApache 2.0 permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 188 days since the last release
Last repo commit
First released
Downloads429,288,446 / month, #98 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Utilities

Evidence: tenacity-9.1.4-py3-none-any.whl

Tags

Capabilities
retry decorator pythonautomatic retry logicexponential backoff libraryretry with timeoutexception retry handlerflaky function resilienceretry policy framework
Topics
resiliencefault-toleranceasync-ready

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “flaky function resilience”

  • tenacityTenacity is a retry library that adds automatic retry behavior to…
  • httpx-retriesAdds automatic request retry logic to HTTPX, with configurable…
  • pytest-retrypytest-retry is a pytest plugin that automatically retries failed…

Give your agent the search over MCP, or paste the wish link into any chat.

More Utilities packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
charset-normalizer Worth it
PyPI · Utilities · released Aug 2026

Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.

permissive licensepure Python · 3.7+
1.7Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
Pygments Worth it
PyPI · Utilities · released Mar 2026

Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.

Install it if you need to display or transform source code.

BSD-2-Clausepure Python · 3.9+
1.3Bdownloads / mo
six With conditions
PyPI · Libraries · released Dec 2024

Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.

MITpure Python
1.2Bdownloads / mo

See also retryhttp · retrying · stamina · python-retry · robust-downloader · reretry · retry · retry2 · redo · backoff