Skip to main content

unbreak

PyPI version Python versions License: MIT

Smart retry library with adaptive backoff, circuit breaker, fallback chains, and dead letter queues.

Install

pip install unbreak

Quick Start

import unbreak

@unbreak.retry(max=5, backoff="exponential")
def call_api():
    ...

# With circuit breaker
@unbreak.retry(max=5, circuit=True)
def call_api():
    ...

# Time budget mode
@unbreak.retry(budget="30s")
def call_api():
    ...

# Fallback chain
@unbreak.retry(max=3, fallback=[redis_get, db_query, lambda: "default"])
def call_api():
    ...

Features

  • Backoff strategies: fixed, exponential, adaptive (learns from response times)
  • Circuit breaker: sliding window, predictive degradation detection
  • Smart error detection: HTTP, DB, network, custom
  • Time budget mode: retries within a time window
  • Fallback chains: cascading fallbacks
  • Dead letter queue: in-memory, file (JSONL), custom backends
  • Coordinated jitter: distributed thundering herd prevention
  • Observability: structured event callbacks
  • Retry history: per-call timeline tracking
  • Async support: full asyncio support
  • Zero dependencies: stdlib only

License

MIT


Part of the thecliffhanger open source suite.

Metadata

Release files for unbreak 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unbreak 0.5.0
File Size Uploaded Provenance Actions
unbreak-0.5.0.tar.gz 35.5 kB Without provenance Details for unbreak-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unbreak 0.5.0
File Interpreter ABI Platform Actions
unbreak-0.5.0-py3-none-any.whl Python 3 none any Details for unbreak-0.5.0-py3-none-any.whl

Total release size: 53.0 kB

Release files / unbreak-0.5.0.tar.gz

Download URL unbreak-0.5.0.tar.gz
Size 35.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2a377ee7a87074ebfa8f26fb446f50cc45dd3caab7e9060d84d65585ea04d14d
BLAKE2b-256 checksum
How to use checksums
048ad47fa4675f651df9851de5df749e700a5550d6d18687a05ea20219b0be12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release files / unbreak-0.5.0-py3-none-any.whl

Download URL unbreak-0.5.0-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a641056d83e29ad5e5c451765ecb3530108d68e790712c97a8f9c33483403a2
BLAKE2b-256 checksum
How to use checksums
6e35770b6a39c89edb67ef37dabab52652ceddce2ba8f2d91399a5b0b6222592
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Security for unbreak 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page