python-resilience

Implement retries, exponential backoff, timeouts, and fault-tolerant decorators in Python.

Updated Jul 8, 2026
One-click install
npx skills add https://github.com/PriyanshKuniyal/gemini-cli-resources --skill python-resilience-priyanshkuniyal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-resilience
Source: https://github.com/PriyanshKuniyal/gemini-cli-resources/tree/main/extensions/claude-code-workflows/plugins/python-development/skills/python-resilience
Command: npx skills add https://github.com/PriyanshKuniyal/gemini-cli-resources --skill python-resilience-priyanshkuniyal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires tenacity, httpx, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you create Python applications that gracefully handle transient failures, network issues, and service outages, ensuring your systems remain reliable and robust.

Core Features & Use Cases

  • Retry Logic: Implement automatic retries for external service calls.
  • Timeouts: Set timeouts for network operations to prevent hangs.
  • Fault Tolerance: Build fault-tolerant microservices and handle transient failures.
  • Use Case: If you're developing a service that interacts with external APIs, this Skill can help you handle network timeouts and transient errors gracefully.

Quick Start

Use the python-resilience skill to add retry logic to your API calls.

Frequently Asked Questions about python-resilience

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

FAQPage Schema
How do I add retry logic to Python API calls to handle transient failures?

To add retry logic to Python API calls, you implement automatic retries with exponential backoff. This approach helps your applications gracefully handle transient failures and network issues by automatically reattempting failed external service requests.

What are the best resilience patterns for building fault-tolerant Python microservices?

The best resilience patterns for fault-tolerant Python microservices include automatic retries, exponential backoff, and timeouts. Using fault-tolerant decorators prevents network operations from hanging and ensures systems handle transient failures and service outages robustly.

How do I set timeouts for Python network operations to prevent hangs?

To set timeouts for Python network operations and prevent hangs, apply fault-tolerant decorators to your functions. This ensures external service calls are bounded by strict time limits, maintaining reliable operation during network delays or outages.

Do I need the tenacity and httpx libraries to implement fault tolerance in Python?

Yes, you need the tenacity and httpx libraries to implement fault tolerance using this approach. Tenacity provides the automatic retry and exponential backoff mechanisms, while httpx handles the underlying network operations for external service calls.

When should I use exponential backoff for Python retry logic?

You should use exponential backoff for Python retry logic when interacting with external APIs that experience transient errors or network timeouts. It gradually increases the delay between retries, preventing overload on recovering services and handling service outages gracefully.