circuitbreaker
Python Circuit Breaker pattern implementation
Decision gist · record as of 2026-08-14
Yes. CircuitBreaker is a straightforward, dependency-free implementation of a well-established resilience pattern. It works with both sync and async code, has no install friction, and carries a permissive license. The aging maintenance status (last release 501 days ago) is a minor concern for a stable, narrowly-scoped library, but verify that its feature set and behavior match your needs before adopting it in production.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with no runtime dependencies.
- Maintenance is aging—last commit was 2025-03-31 and the project has not released since then, though the repository remains active and not archived.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is a permissive license, allowing broad use, modification, and distribution with minimal restrictions.
last release 2025-03-31 (501 days) · last repo commit 2025-03-31 · 522 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 10,803,044 downloads/mo, #1,433 on PyPI
Alternatives
Verify before relying
from circuitbreaker import circuit
@circuit
def external_call():
pass
# Or with configuration:
@circuit(failure_threshold=10, expected_exception=ConnectionError)
def external_call():
pass- Whether the aging maintenance status (501 days since last release) affects stability or security for production use.
- Performance characteristics under high-concurrency or high-failure-rate scenarios.
- Compatibility with modern async frameworks beyond basic async/await support.
What it is and what it does
CircuitBreaker is a Python decorator that implements the Circuit Breaker pattern to protect distributed systems from cascading failures. When you decorate a function with @circuit, the decorator monitors execution, counts failures, and stops calling the function after a configurable threshold (default: 5 failures) is reached. After a recovery timeout (default: 30 seconds), it enters a half-open state to test whether the integration point has recovered.
The decorator supports both synchronous and asynchronous functions, and you can customize which exceptions trigger the circuit to open, set different failure thresholds and recovery timeouts, and provide fallback functions to execute when the circuit is open. It also integrates with a CircuitBreakerMonitor to track the health and state of all active circuit breakers in your application.
Use it for
- Protect HTTP clients from repeatedly calling unavailable external APIs by opening the circuit after connection failures.
- Prevent database connection pools from exhausting resources when a database is temporarily down.
- Implement graceful degradation in microservices by using fallback functions when downstream services are unavailable.
- Monitor the health of multiple integration points across your application via CircuitBreakerMonitor.
- Rate-limit or fail fast on specific HTTP errors (e.g., 429 Too Many Requests) using custom exception logic.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
CircuitBreaker is a straightforward, dependency-free implementation of a well-established resilience pattern. It works with both sync and async code, has no install friction, and carries a permissive license. The aging maintenance status (last release 501 days ago) is a minor concern for a stable, narrowly-scoped library, but verify that its feature set and behavior match your needs before adopting it in production.
Install
circuitbreaker on PyPI
Before you install
Low install friction with no runtime dependencies. Maintenance is aging—last commit was 2025-03-31 and the project has not released since then, though the repository remains active and not archived.
License in practice
BSD-3-Clause is a permissive license, allowing broad use, modification, and distribution with minimal restrictions.
Quickstart
from circuitbreaker import circuit
@circuit
def external_call():
pass
# Or with configuration:
@circuit(failure_threshold=10, expected_exception=ConnectionError)
def external_call():
pass
Verify before relying
- Whether the aging maintenance status (501 days since last release) affects stability or security for production use.
- Performance characteristics under high-concurrency or high-failure-rate scenarios.
- Compatibility with modern async frameworks beyond basic async/await support.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 501 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 10,803,044 / month, #1,433 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: MacOSOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: circuitbreaker-2.1.3-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 › “prevent cascading failures”
- circuitbreakerA Python decorator that implements the Circuit Breaker pattern to…
- aiobreakerImplements the Circuit Breaker pattern for asyncio applications,…
- purgatoryPurgatory implements the circuit breaker pattern for both synchronous…
Give your agent the search over MCP, or paste the wish link into any chat.
More Monitoring packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.
Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.
Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.
Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.
Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.
Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.
Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.
Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.
See also aiobreaker · purgatory · pybreaker · metaflow-checkpoint · retry2 · singleton-decorator · multimethod · python-backoff · pytest-check · delayed-assert