Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/danielfm/pybreaker/llms.txt

Use this file to discover all available pages before exploring further.

PyBreaker is available on PyPI and installs with a single command. It has no required dependencies — the core circuit breaker functionality works out of the box, with optional extras for Redis-backed distributed state and Tornado async support.

Requirements

  • Python 3.9 or later
No other packages are required for the core library. Redis and Tornado are only needed if you intend to use those specific integrations.

Install from PyPI

Install PyBreaker using pip:
pip install pybreaker
This installs the core package, including CircuitBreaker, CircuitBreakerListener, CircuitBreakerError, and the in-memory CircuitMemoryStorage.

Optional Dependencies

PyBreaker’s Redis and Tornado integrations are not installed by default. Install the relevant extra package alongside PyBreaker depending on the integration you need.
Install the redis package to enable CircuitRedisStorage, which allows circuit state to be shared across multiple processes or hosts:
pip install pybreaker redis
Do not initialize the Redis connection with decode_responses=True. This forces ASCII objects from Redis and will fail in Python 3+ with AttributeError: 'str' object has no attribute 'decode' when PyBreaker tries to decode the raw bytes it expects back from Redis.

Development Installation

To contribute to PyBreaker or run the test suite locally, clone the repository and install it in editable mode:
git clone git://github.com/danielfm/pybreaker.git
cd pybreaker
pip install -e .
Installing in editable mode (-e) means changes you make to the source files are reflected immediately without reinstalling.

Verify Installation

Confirm PyBreaker is correctly installed by importing it and printing its public API:
import pybreaker
print(pybreaker.__all__)
You should see:
('CircuitBreaker', 'CircuitBreakerListener', 'CircuitBreakerError', 'CircuitMemoryStorage', 'CircuitRedisStorage', 'STATE_OPEN', 'STATE_CLOSED', 'STATE_HALF_OPEN')

Build docs developers (and LLMs) love