pyramid-retry
An execution policy for Pyramid that supports retrying requests after certain failure exceptions.
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-retryuv
uv add pyramid-retrypoetry
poetry add pyramid-retryInstalling 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
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
pyramid-tmIntegrates Pyramid web requests with the…
permissive · top 15,000 on PyPI
retryingRetrying is a decorator-based library that adds…
permissive · top 1,000 on PyPI
pyramidPyramid is a Python web framework for building…
permissive · top 5,000 on PyPI
aioretryProvides a decorator-based retry mechanism for…
permissive · top 15,000 on PyPI
retryhttpRetryhttp wraps HTTP client calls to…
permissive · top 5,000 on PyPI
reretryA decorator and function wrapper for retrying…
permissive · top 15,000 on PyPI
python-retryProvides a decorator to automatically retry…
permissive · top 15,000 on PyPI
retryProvides a decorator and function wrapper for…
permissive · top 1,000 on PyPI
corniceCornice provides decorators and utilities to…
copyleft · top 15,000 on PyPI
django-dbconn-retryAutomatically reconnects Django database…
permissive · top 15,000 on PyPI