purgatory
A circuit breaker implementation for asyncio
Decision gist · record as of 2026-08-14
Yes, if you need circuit breaker functionality for async or sync code. The library is permissively licensed, has no external dependencies, and is fully typed. However, the aging maintenance status (650 days since last release) means you should verify that the library's feature set and behavior match your exact needs before committing to it in a critical system.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Low install friction with no runtime dependencies.
- Maintenance shows aging status—last release was 650 days ago, though the repository remains active with a recent commit on 2025-07-15.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) allows free use, modification, and distribution in both open-source and proprietary projects with minimal restrictions.
last release 2024-11-02 (650 days) · last repo commit 2025-07-15 · 4 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 582,192 downloads/mo, #5,901 on PyPI
Alternatives
Verify before relying
from purgatory import AsyncCircuitBreakerFactory
circuitbreaker = AsyncCircuitBreakerFactory()
async with await circuitbreaker.get_breaker("my_circuit"):
# protected code here
pass- Whether Redis backend integration is production-ready and what configuration is required.
- Performance characteristics under high concurrency or with many simultaneous circuit breakers.
- Compatibility with popular async frameworks beyond asyncio (e.g., Trio, Curio).
What it is and what it does
Purgatory is a Python circuit breaker library that wraps calls to external services or dependencies to detect and respond to failures. It implements the circuit breaker design pattern, which maintains system stability by preventing repeated calls to failing services during outages or maintenance windows. The library supports both synchronous and asynchronous code paths and can be used as a context manager or decorator, making it flexible for different integration patterns.
The library offers configurable state storage (in-memory or Redis), event hooks for monitoring circuit state changes, and full type annotations. It's designed for distributed systems where shared state across multiple processes is important, and it provides visibility into circuit behavior through monitoring events.
Use it for
- Wrap HTTP calls to external APIs to prevent request storms when a service is temporarily down.
- Protect database queries in microservices to stop cascading failures across service boundaries.
- Monitor and react to circuit state changes in real time using event hooks for alerting or logging.
- Share circuit state across multiple application instances using Redis as a distributed backend.
- Decorate async functions in asyncio applications to add automatic failure isolation without refactoring.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need circuit breaker functionality for async or sync code.
The library is permissively licensed, has no external dependencies, and is fully typed. However, the aging maintenance status (650 days since last release) means you should verify that the library's feature set and behavior match your exact needs before committing to it in a critical system.
Install
purgatory on PyPI
Before you install
Low install friction with no runtime dependencies. Maintenance shows aging status—last release was 650 days ago, though the repository remains active with a recent commit on 2025-07-15.
Requires Python 3.9 or later.
License in practice
MIT license (permissive) allows free use, modification, and distribution in both open-source and proprietary projects with minimal restrictions.
Quickstart
from purgatory import AsyncCircuitBreakerFactory
circuitbreaker = AsyncCircuitBreakerFactory()
async with await circuitbreaker.get_breaker("my_circuit"):
# protected code here
pass
Verify before relying
- Whether Redis backend integration is production-ready and what configuration is required.
- Performance characteristics under high concurrency or with many simultaneous circuit breakers.
- Compatibility with popular async frameworks beyond asyncio (e.g., Trio, Curio).
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 650 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 582,192 / month, #5,901 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleFramework :: AsyncIOIntended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentTopic :: Internet :: WWW/HTTPTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: MonitoringTopic :: System :: NetworkingTyping :: Typed |
Evidence: purgatory-3.0.1-py3-none-any.whl
Tags
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 › “circuit breaker pattern”
- purgatoryPurgatory implements the circuit breaker pattern for both synchronous…
- pybreakerPyBreaker wraps function calls with a circuit breaker that…
- aiobreakerImplements the Circuit Breaker pattern for asyncio applications,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
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.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
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.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also circuitbreaker · aiobreaker · pybreaker · waiter · vercel-cache · synchronicity · pytest-check · pytest-instafail · janus · stamina