Skip to main content

Syncora Resilience Engine (syncora-resilience)

PyPI version License: Apache-2.0 Python Version Code Coverage Architecture

A production-grade, zero-dependency fault tolerance toolkit engineered for high-throughput Python microservices, distributed RPC pipelines, and mission-critical cloud backends.


Architectural Highlights

  • Three-State Circuit Breakers: Protect upstream systems from cascading downtime using finite state machines (CLOSED -> OPEN -> HALF_OPEN).
  • Jittered Exponential Retries: Mitigate thundering herd problems with full-jitter backoff for synchronous functions and asyncio coroutines.
  • Token Bucket Rate Limiting: Enforce hard concurrency bounds and smooth bursty traffic spikes.
  • Zero Third-Party Dependencies: Pure standard library implementation with nanosecond-scale overhead.

Installation

pip install syncora-resilience

Usage

1. Circuit Breaker Protection

from syncora import CircuitBreaker, CircuitBreakerOpenError

breaker = CircuitBreaker(
    name="payment-gateway",
    failure_threshold=5,
    recovery_timeout=30.0
)

@breaker
def charge_customer(account_id: str, amount_cents: int):
    # Remote HTTP call to payment processor
    return remote_payment_api.charge(account_id, amount_cents)

try:
    charge_customer("acc_94821", 5000)
except CircuitBreakerOpenError:
    # Circuit is open - immediate fallback, avoiding socket exhaustion
    enqueue_offline_retry("acc_94821", 5000)

2. Async Exponential Retries with Full Jitter

import httpx
from syncora import retry, BackoffPolicy

@retry(
    max_attempts=4,
    initial_delay=0.1,
    max_delay=5.0,
    backoff=BackoffPolicy.EXPONENTIAL,
    jitter=True,
    exceptions=(httpx.ConnectTimeout, httpx.ReadTimeout)
)
async def fetch_user_profile(user_id: str):
    async with httpx.AsyncClient() as client:
        resp = await client.get(f"https://users.internal.net/{user_id}", timeout=2.0)
        resp.raise_for_status()
        return resp.json()

3. High-Throughput Token Bucket Limiter

from syncora import TokenBucketRateLimiter

limiter = TokenBucketRateLimiter(rate=200.0, capacity=50.0)

def handle_incoming_webhook(event):
    if not limiter.acquire(1):
        return {"status": 429, "error": "Too Many Requests"}
    return process_event(event)

Benchmark Suite

Run the built-in latency benchmark:

syncora bench

License

Syncora Resilience Engine is distributed under the Apache License 2.0. Copyright 2026 Syncora Systems Ltd.

Metadata

Release files for syncora-resilience 1.0.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 syncora-resilience 1.0.0
File Size Uploaded Provenance Actions
syncora_resilience-1.0.0.tar.gz 8.5 kB Without provenance Details for syncora_resilience-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for syncora-resilience 1.0.0
File Interpreter ABI Platform Actions
syncora_resilience-1.0.0-py3-none-any.whl Python 3 none any Details for syncora_resilience-1.0.0-py3-none-any.whl

Total release size: 16.6 kB

Release files / syncora_resilience-1.0.0.tar.gz

Download URL syncora_resilience-1.0.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
91cdf8a87b0e0484a522c312079269c67559ec0fe528ced5fa4b8b5caf96dc0e
BLAKE2b-256 checksum
How to use checksums
232596fb429caa1660f8a15901453f563060335cf1236d04aa6290222d7aff20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / syncora_resilience-1.0.0-py3-none-any.whl

Download URL syncora_resilience-1.0.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4807b1a790cd096d7beeecb6d3ed5769b4d65b0457d17144d8efb1545d052f35
BLAKE2b-256 checksum
How to use checksums
a5a5f909dd8457eeb4e0f57f8b880077cccd8a5eae4b29a0a39db510d3801af0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Security for syncora-resilience 1.0.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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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