skillfed

pyramid-retry

An execution policy for Pyramid that supports retrying requests after certain failure exceptions.

pyramid-retry v2.1.1 79.1K downloads/30d#14,382 on PyPI6
Permissive license Active released

What it is and what it does

pyramid_retry is an execution policy for the Pyramid web framework that intercepts request handling and automatically retries failed requests under certain conditions. When a request raises an exception that the policy considers retryable, it will attempt to re-execute the request up to a configurable limit before allowing the error to propagate. The policy is configured via settings and can be customized per-request through hooks; it also fires events before each retry attempt, allowing applications to perform cleanup or state management.

The package depends on pyramid and zope.interface and integrates directly into Pyramid's request/response cycle. It is useful for handling transient failures in web applications—network glitches, temporary resource unavailability, or other recoverable errors—without requiring explicit retry logic in application code.

Use it for:

  • Automatically retry requests that fail due to transient database connection issues or temporary service unavailability.
  • Handle client disconnects gracefully by ensuring threadlocals are cleaned up even when retries fail.
  • Implement per-request retry limits using a custom activate_hook to vary retry behavior based on request properties.
  • Subscribe to IBeforeRetry events to reset request state or clean up resources before each retry attempt.
  • Mark specific exceptions as retryable using mark_error_retryable so the policy knows which errors warrant a retry.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pyramid_retry wraps Pyramid requests with configurable retry logic, automatically retrying requests under specified error conditions before reporting failure to the client.

Yes, if you are building a Pyramid application and need automatic retry logic for transient failures. The package is stable (Production/Stable status), has low install friction, and is actively maintained. However, note that the last release was in 2020; verify compatibility with your Pyramid version before adopting.

Install

pyramid-retry on PyPI

pip

pip install pyramid-retry

uv

uv add pyramid-retry

poetry

poetry add pyramid-retry

Installing pyramid-retry

Before you install

Low install friction: pure Python wheel with only two runtime dependencies (pyramid and zope.interface). Maintenance status is active with recent commits, though the last release was in 2020.

License in practice

MIT license (permissive): you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install pyramid-retry

from pyramid.config import Configurator
config = Configurator()
config.include('pyramid_retry')

Requires Pyramid framework to be installed and configured; pyramid_retry is an execution policy that integrates into Pyramid's request handling pipeline.

Verify before relying

  • Whether the package supports Python versions beyond 3.7 (classifiers list 3.7 as the latest tested version).
  • Current compatibility with modern Pyramid versions (last release was 2020; Pyramid may have evolved significantly).

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 2 — pyramid, zope.interface
Maintenance actively maintained — 2,337 days since the last release
Last repo commit
First released
Downloads 79,095/month — #14,382 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyramid_retry-2.1.1-py2.py3-none-any.whl

Keywords: pyramid, wsgi, retry, attempt

Development Status :: 5 - Production/StableFramework :: PyramidIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

pyramid request retrywsgi retry policyautomatic request retrypyramid error recoveryconfigurable retry attemptspyramid execution policytransient error handling
pyramid-pluginfault-tolerancewsgi

More Application Frameworks packages