Quarantine — by Aritro Saha

Zero-dependency dead-letter queue and fault-tolerance library on PyPI & Conda-Forge. Wrap Python loops with @quarantine to isolate errors without crashing batch jobs.

Quarantine - Dead-letter queues for Python loops
Quarantine - Dead-letter queues for Python loops

Project Overview & Architecture

quarantine is an open-source, zero-dependency Python library that brings dead-letter queue resilience to regular loops and batch data pipelines. When processing thousands of records (e.g., CSV ingestion, scraping, API syncing), an unexpected exception at item #5,247 no longer crashes the entire multi-hour run. quarantine safely isolates the failing item, captures the error and full execution state to disk, and keeps the loop running.

Core Features & Capabilities

Zero-Crash Decorators

Wrap any sync or async function with @quarantine or iterate with shield() to set aside failures without interrupting the pipeline.

Atomic On-Disk Isolation

Serializes failed inputs, exceptions, and full tracebacks atomically to disk (.quarantine/) without requiring external message brokers.

Surgical Replays & Interactive Debugging

Rerun only failed items using quarantine retry or drop straight into pdb with the exact failing input using quarantine debug.

Circuit Breakers & Sensitive Redaction

Automatic circuit breaker tripping via halt_after to prevent cascading external outages, plus built-in key/regex redaction for secrets.

Local Web UI & Observability

Built-in CLI commands and a local web dashboard to inspect tracebacks, track recovery stats, and integrate into CI/CD pipelines.

Technical Specifications & Engineering

Engineering Tech Stack

  • Python 3.9+
  • PyPI
  • Conda-Forge
  • AsyncIO
  • CLI
  • Dead-Letter Queue
  • Fault Tolerance
  • Pytest
  • Hypothesis

Dedicated Webpages & Official Resources