python-resilience

Implement retry and fault-tolerance patterns for Python services using tenacity.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/ArogyaReddy/https-github.com-wshobson-agents --skill python-resilience-arogyareddy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-resilience
Source: https://github.com/ArogyaReddy/https-github.com-wshobson-agents/tree/main/plugins/python-development/skills/python-resilience
Command: npx skills add https://github.com/ArogyaReddy/https-github.com-wshobson-agents --skill python-resilience-arogyareddy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Python resilience patterns help developers build fault-tolerant applications that gracefully handle transient failures, timeouts, and unreliable dependencies.

Core Features & Use Cases

  • Automatic retries with exponential backoff and jitter to prevent cascading failures
  • Timeout handling to keep systems responsive and degrade gracefully
  • Decorators and utilities for applying resilience consistently across services
  • Circuit breakers and fail-safe defaults to protect downstream systems
  • Use Case: Wrap external API calls, database queries, or message-driven pipelines to improve reliability

Quick Start

Wrap a function with a retry decorator to automatically retry on transient failures.

Frequently Asked Questions about python-resilience

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement retries with exponential backoff in Python?

To implement retries with exponential backoff in Python, you can use decorators to wrap functions and automatically retry transient failures. This approach adds jitter to prevent cascading failures and keeps systems responsive during temporary outages.

What is a circuit breaker pattern and when do I need it for microservices?

A circuit breaker pattern protects downstream microservices by failing fast when dependencies are unavailable. You need it when wrapping external API calls or database queries to prevent cascading failures and ensure your system degrades gracefully during outages.

How do I handle timeouts and transient failures in Python network calls?

To handle timeouts and transient failures in Python network calls, apply fault-tolerance patterns like automatic retries with jitter. Wrapping network functions with resilience decorators ensures systems remain responsive and recover from temporary connectivity issues.

Do I need external libraries to add fault tolerance to Python services?

Yes, implementing robust fault tolerance in Python services requires libraries like tenacity for retries. These libraries provide the decorators and utilities needed to apply exponential backoff, jitter, and circuit-breaker implementations consistently.

Can I use retry decorators for database queries and message-driven pipelines?

Yes, you can apply retry decorators to database queries and message-driven pipelines. Wrapping these operations with fault-tolerance patterns improves reliability by automatically retrying transient failures and protecting downstream systems.

When should I not use automatic retries for Python fault tolerance?

Automatic retries are not suitable for non-transient failures or operations that are not idempotent. If a Python network call permanently fails or causes duplicate side effects, retrying can worsen system load and cascading failures instead of improving reliability.