{"library":"reretry","title":"Reretry","description":"Reretry is a Python library providing an easy-to-use, yet functional decorator for retrying functions on exceptions. It is a fork of the `retry` package, enhancing it with features like logging of traceback, callbacks after each failure, and support for `async` functions. Currently at version 0.11.8, it is actively maintained with a focus on providing a robust retry mechanism with minimal dependencies.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install reretry"],"cli":null},"imports":["from reretry import retry"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import random\nimport asyncio\nfrom reretry import retry\n\nattempt_count = 0\n\n@retry(exceptions=ValueError, tries=3, delay=1)\ndef flaky_sync_function():\n    global attempt_count\n    attempt_count += 1\n    print(f\"Sync function attempt {attempt_count}...\")\n    if random.randint(1, 10) < 7:\n        raise ValueError(\"Sync operation failed!\")\n    print(\"Sync operation succeeded!\")\n    return \"Success\"\n\nasync_attempt_count = 0\n\n@retry(exceptions=RuntimeError, tries=2, delay=0.5)\nasync def flaky_async_function():\n    global async_attempt_count\n    async_attempt_count += 1\n    print(f\"Async function attempt {async_attempt_count}...\")\n    if random.randint(1, 10) < 8:\n        raise RuntimeError(\"Async operation failed!\")\n    print(\"Async operation succeeded!\")\n    return \"Async Success\"\n\nif __name__ == \"__main__\":\n    print(\"\\n--- Running Synchronous Example ---\")\n    try:\n        result_sync = flaky_sync_function()\n        print(f\"Final sync result: {result_sync}\")\n    except Exception as e:\n        print(f\"Sync function ultimately failed: {e}\")\n\n    print(\"\\n--- Running Asynchronous Example ---\")\n    try:\n        result_async = asyncio.run(flaky_async_function())\n        print(f\"Final async result: {result_async}\")\n    except Exception as e:\n        print(f\"Async function ultimately failed: {e}\")","lang":"python","description":"This quickstart demonstrates both synchronous and asynchronous usage of the `@retry` decorator. The `flaky_sync_function` will retry up to 3 times with a 1-second delay on `ValueError`, while `flaky_async_function` retries twice with a 0.5-second delay on `RuntimeError`. The `asyncio.run()` is used to execute the asynchronous example.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"0.11.8","pypi_latest":"0.11.8","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.5,"avg_import_s":0.2,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"reretry","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.09,"mem_mb":4,"disk_size":"17.8M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"reretry","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.4,"import_time_s":0.06,"mem_mb":4,"disk_size":"18M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"reretry","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.16,"mem_mb":5,"disk_size":"19.6M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"reretry","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.5,"import_time_s":0.14,"mem_mb":5,"disk_size":"20M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"reretry","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.35,"mem_mb":8.2,"disk_size":"11.5M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"reretry","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.4,"import_time_s":0.33,"mem_mb":8.2,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"reretry","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.39,"mem_mb":8.7,"disk_size":"11.3M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"reretry","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.4,"import_time_s":0.34,"mem_mb":8.7,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"reretry","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.08,"mem_mb":3.9,"disk_size":"17.3M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"reretry","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.7,"import_time_s":0.07,"mem_mb":3.9,"disk_size":"18M"}]}}