{ "info": { "author": "Insight Industry Inc.", "author_email": "software@insightindustry.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "***********************\nBackoff-Utils\n***********************\n\n**Python Library for Backoff/Retry Strategies**\n\n.. list-table::\n :widths: 10 90\n :header-rows: 1\n\n * - Branch\n - Unit Tests\n * - `latest `_\n -\n .. image:: https://travis-ci.org/insightindustry/backoff-utils.svg?branch=latest\n :target: https://travis-ci.org/insightindustry/backoff-utils\n :alt: Build Status (Travis CI)\n\n .. image:: https://codecov.io/gh/insightindustry/backoff-utils/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/insightindustry/backoff-utils\n :alt: Code Coverage Status (Codecov)\n\n .. image:: https://readthedocs.org/projects/backoff-utils/badge/?version=latest\n :target: http://backoff-utils.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status (ReadTheDocs)\n\n * - `v. 1.0.0 `_\n -\n .. image:: https://travis-ci.org/insightindustry/backoff-utils.svg?branch=v.1.0.0\n :target: https://travis-ci.org/insightindustry/backoff-utils\n :alt: Build Status (Travis CI)\n\n .. image:: https://codecov.io/gh/insightindustry/backoff-utils/branch/v.1.0.0/graph/badge.svg\n :target: https://codecov.io/gh/insightindustry/backoff-utils\n :alt: Code Coverage Status (Codecov)\n\n .. image:: https://readthedocs.org/projects/backoff-utils/badge/?version=v.1.0.0\n :target: http://backoff-utils.readthedocs.io/en/latest/?badge=v.1.0.0\n :alt: Documentation Status (ReadTheDocs)\n\n * - `develop `_\n -\n .. image:: https://travis-ci.org/insightindustry/backoff-utils.svg?branch=develop\n :target: https://travis-ci.org/insightindustry/backoff-utils\n :alt: Build Status (Travis CI)\n\n .. image:: https://codecov.io/gh/insightindustry/backoff-utils/branch/develop/graph/badge.svg\n :target: https://codecov.io/gh/insightindustry/backoff-utils\n :alt: Code Coverage Status (Codecov)\n\n .. image:: https://readthedocs.org/projects/backoff-utils/badge/?version=develop\n :target: http://backoff-utils.readthedocs.io/en/latest/?badge=develop\n :alt: Documentation Status (ReadTheDocs)\n\n**Backoff-Utils** is a Python library that provides Python functions and decorators\nthat apply various backoff / retry strategies to your Python function and method\ncalls.\n\nThe library has a consistent syntax for easy use, and has been tested on\nPython 2.7, 3.4, 3.5, and 3.6.\n\n**COMPLETE DOCUMENTATION ON READTHEDOCS:** http://backoff-utils.readthedocs.io/en/latest\n\n.. contents::\n :local:\n :depth: 3\n :backlinks: entry\n\n--------------\n\nInstallation\n==================\n\nTo install **Backoff-Utils**, just execute:\n\n.. code:: bash\n\n $ pip install backoff-utils\n\nImporting\n-------------\n\nOnce installed, to import **Backoff-Utils** into your project you can use:\n\n.. code-block:: python\n\n #: Import the backoff() function.\n from backoff_utils import backoff\n\n #: Import the @apply_backoff() decorator.\n from backoff_utils import apply_backoff\n\n #: Import backoff strategies.\n from backoff_utils import strategies\n\nDependencies\n---------------\n\nBy design, **Backoff-Utils** are designed to rely on minimal dependencies.\nThe only dependency they have outside of the Python standard library is:\n\n* `validator-collection `_\n which provides for robust validation functionality.\n\n This library in turn has one external dependency when installed under Python 2.7:\n\n * `regex `_ which is a drop-in replacement for\n Python's (buggy) standard ``re`` module.\n\n------------------\n\nHello, World Example\n========================\n\n.. code:: python\n\n from backoff_utils import strategies\n\n # Using a Function Call\n from backoff_utils import backoff\n\n def some_function(arg1, arg2, kwarg1 = None):\n # your code goes here\n pass\n\n result = backoff(some_function,\n args = ['value1', 'value2'],\n kwargs = { 'kwarg1': 'value3' },\n max_tries = 3,\n max_delay = 3600,\n strategy = strategies.Exponential)\n\n # Using a Decorator\n from backoff_utils import backoff\n\n @apply_backoff(strategy = strategies.Exponential, max_tries = 3, max_delay = 3600)\n def some_decorated_function(arg1, arg2, kwarg1 = None):\n # your code goes here\n pass\n\n result = some_decorated_function('value1', 'value2', kwarg1 = 'value3')\n\n------------\n\nWhy Backoff-Utils?\n======================\n\n.. epigraph::\n\n *Because now and again, stuff breaks.*\n\nOften, when making external API calls to third-party systems, something goes\nwrong. The internet might glitch. The API we're calling might timeout. Gremlins\nmight eat your packets. Any number of things can go wrong, and Murphy's law tells\nus that they will.\n\nWhich is why we need backoff strategies. Basically, these are techniques\nthat we can use to retry function calls after a given delay - and keep retrying\nthem until either the function call works, or until we've tried so many times that\nwe just give up and handle the error.\n\nThis library is meant to be an incredibly simple utility that provides a number\nof easy-to-use backoff strategies. Its core API is to expose:\n\n * the ``backoff()`` function, which lets you apply\n a given backoff strategy to any Python function call, and;\n * the ``@apply_backoff()`` decorator, which lets\n you decorate any function or method call so that a given backoff strategy is\n *always* applied when the decorated function/method is called.\n\n----------------\n\nLibrary Features\n==================\n\nSupported Strategies\n---------------------\n\nThe library supports five of the most-common backoff strategies that we've come\nacross:\n\n* Exponential\n* Fibonacci\n* Fixed\n* Linear\n* Polynomial\n\nIn addtion, you can also create your own custom strategies as well.\n\n**For more information about the backoff strategies supported, please see:**\n`Strategies Explained `_\n\nAdditional Features\n----------------------\n\nIn addition to the basic strategies, the library also supports:\n\n* random jitter\n* argument-adjustment on retry\n* selective exception capture\n* chained backoff strategies\n* failure handlers\n* success handlers\n* cut-off after max delay\n* cut-off after max tries\n* scaling\n* minimum delay\n\n**For more information about the backoff strategies supported, please see:**\n`Using the Library `_\n\n-------------\n\nFeedback, Support, and Contributing\n====================================\n\nWe're happy to maintain this library going forward, and would always love to\nhear users' feedback - especially if you're running into issues.\n\nPlease report issues or questions on the\n`project's Github page `_\n\n**For more information on contributing to the Backoff-Utils library, please see:**\n`Contributor Guide `_\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/insightindustry/backoff-utils", "keywords": "backoff exponential fibonacci polynomial linear defined fixed retry", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "backoff-utils", "package_url": "https://pypi.org/project/backoff-utils/", "platform": "", "project_url": "https://pypi.org/project/backoff-utils/", "project_urls": { "Homepage": "https://github.com/insightindustry/backoff-utils" }, "release_url": "https://pypi.org/project/backoff-utils/1.0.0/", "requires_dist": [ "validator-collection", "check-manifest; extra == 'dev'", "sphinx; extra == 'dev'", "sphinx-rtd-theme; extra == 'dev'", "sphinx-tabs; extra == 'dev'", "coverage; extra == 'test'", "pytest; extra == 'test'", "pytest-benchmark; extra == 'test'", "pytest-cov; extra == 'test'", "tox; extra == 'test'", "codecov; extra == 'test'" ], "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "summary": "Python functions and decorators for various backoff/retry strategies", "version": "1.0.0" }, "last_serial": 3782642, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "d351934519adb6b82462ca2aac0cf7fd", "sha256": "850c7b747cd25d976840fdb083acaf247464dd2dd889cc40a40e31d0a30b41c3" }, "downloads": -1, "filename": "backoff_utils-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d351934519adb6b82462ca2aac0cf7fd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 12070, "upload_time": "2018-04-20T02:17:12", "url": "https://files.pythonhosted.org/packages/32/ef/6065f7dc4fa0730900b122901987300776f9fafd7d64dd8717ee3b0e7159/backoff_utils-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e89142c2a6d51e6ff43e1d581a61f344", "sha256": "12e561bcb80360c9ab1539499fd6eba40cb0daba7e486aa4ef38e158cdffba60" }, "downloads": -1, "filename": "backoff-utils-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e89142c2a6d51e6ff43e1d581a61f344", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 11985, "upload_time": "2018-04-20T02:17:13", "url": "https://files.pythonhosted.org/packages/4c/06/d6d0dd7dd40cfe60487586f31979c4322070815f25d3c52727f2abe84fd0/backoff-utils-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d351934519adb6b82462ca2aac0cf7fd", "sha256": "850c7b747cd25d976840fdb083acaf247464dd2dd889cc40a40e31d0a30b41c3" }, "downloads": -1, "filename": "backoff_utils-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d351934519adb6b82462ca2aac0cf7fd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 12070, "upload_time": "2018-04-20T02:17:12", "url": "https://files.pythonhosted.org/packages/32/ef/6065f7dc4fa0730900b122901987300776f9fafd7d64dd8717ee3b0e7159/backoff_utils-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e89142c2a6d51e6ff43e1d581a61f344", "sha256": "12e561bcb80360c9ab1539499fd6eba40cb0daba7e486aa4ef38e158cdffba60" }, "downloads": -1, "filename": "backoff-utils-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e89142c2a6d51e6ff43e1d581a61f344", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 11985, "upload_time": "2018-04-20T02:17:13", "url": "https://files.pythonhosted.org/packages/4c/06/d6d0dd7dd40cfe60487586f31979c4322070815f25d3c52727f2abe84fd0/backoff-utils-1.0.0.tar.gz" } ] }