{"library":"retry-decorator","title":"Retry Decorator","description":"The `retry-decorator` library provides a simple yet powerful decorator for retrying function calls upon specified exceptions. It supports features like setting maximum retries, exponential backoff, and logging failed attempts. Version 1.1.1 is the latest release, with future versions planned to drop Python 2 support. The project appears to be actively maintained, though releases are infrequent.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install retry-decorator"],"cli":null},"imports":["from python_retry import retry"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import logging\nfrom python_retry import retry\n\nLOGGER = logging.getLogger(__name__)\n\n@retry(max_retries=3,\n       backoff_factor=1,\n       retry_on=(ValueError,),\n       retry_logger=LOGGER)\ndef flaky_function():\n    print(\"Attempting flaky operation...\")\n    if hasattr(flaky_function, 'calls'):\n        flaky_function.calls += 1\n    else:\n        flaky_function.calls = 1\n\n    if flaky_function.calls < 3:\n        raise ValueError(\"Simulated transient error\")\n    print(\"Operation successful!\")\n    return \"Success Data\"\n\nif __name__ == \"__main__\":\n    try:\n        result = flaky_function()\n        print(f\"Final result: {result}\")\n    except ValueError as e:\n        print(f\"Operation failed after multiple retries: {e}\")","lang":"python","description":"This example demonstrates how to use the `@retry` decorator with explicit exception handling, a maximum number of retries, and a basic backoff factor. It also configures a logger to show retry attempts.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"1.1.1","pypi_latest":"1.1.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":2.4,"avg_import_s":null,"wheel_type":"sdist"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"retry-decorator","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"19.2M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"retry-decorator","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":2,"import_time_s":null,"mem_mb":null,"disk_size":"20M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"retry-decorator","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"21.6M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"retry-decorator","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":2,"import_time_s":null,"mem_mb":null,"disk_size":"22M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"retry-decorator","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.5M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"retry-decorator","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":3,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"retry-decorator","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.3M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"retry-decorator","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":2.6,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"retry-decorator","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"18.8M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"retry-decorator","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":2.3,"import_time_s":null,"mem_mb":null,"disk_size":"19M"}]}}