{ "info": { "author": "Allen Sanabria", "author_email": "asanabria@linuxdynasty.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Build Tools" ], "description": "========================================\nAWSRetry - Boto3 Retry/Backoff Decorator\n========================================\n\nAWSRetry is a Python Decorator that can be used to wrap boto3 function calls.\nThis function was built out of the need to get around a couple of common issues\nwhen working with AWS API's.\n\n* Query API Request Rate\n* Eventual Consistency Model.\n\n\nExceptions that will get retried when encountered\n-------------------------------------------------\n* RequestLimitExceeded\n* Unavailable\n* ServiceUnavailable\n* InternalFailure\n* InternalError\n* ^\\w+.NotFound\n\nThis list can be extended. (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html)\n\nQuick Start\n-----------\nInstall awsretry.\n\n.. code-block:: sh\n\n $ pip install awsretry\n\nI will assume you know about setting up Boto3 Credentials, if not you can read\nthe instructions here http://boto3.readthedocs.io/en/latest/guide/configuration.html\n\n\nKeyword Arguments that AWSRetry.backoff accepts\n-----------------------------------------------\n\n* tries = The number of times to try before giving up. Default = 10\n* delay = The initial delay between retries in seconds. Default = 3\n* backoff = backoff multiplier e.g. value of 2 will double the delay each retry. Default = 1.1\n* added_exceptions = Other exceptions to retry on, beyond the defaults. Default = list()\n\nExamples\n--------\nWrite a quick function that implements AWSRetry.backoff()\n\n.. code-block:: python\n\n #!/usr/bin/env python\n\n import botocore\n import boto3\n from awsretry import AWSRetry\n\n\n @AWSRetry.backoff()\n def get_instances():\n client = boto3.client('ec2')\n try:\n instances = client.describe_instances()\n return instances\n except botocore.exceptions.ClientError as e:\n raise e:\n\n instances = get_instances()\n\nWrite a quick function that will overwrite the default arguments.\n\n.. code-block:: python\n\n #!/usr/bin/env python\n\n import botocore\n import boto3\n from awsretry import AWSRetry\n\n\n @AWSRetry.backoff(tries=20, delay=2, backoff=1.5, added_exceptions=['ConcurrentTagAccess'])\n def create_tags():\n client = boto3.client('ec2')\n try:\n resources = ['1-12345678891234']\n tags = [{'Key': 'service'}, {'Value': 'web-app'}]\n instances = client.create_tags(Resources=resources)\n except botocore.exceptions.ClientError as e:\n raise e:\n\n create_tags()\n\nDevelopment\n-----------\nAssuming that you have Python and ``virtualenv`` installed, set up your\nenvironment and install the required dependencies like this instead of\nthe ``pip install awsretry`` defined above:\n\n.. code-block:: sh\n\n $ git clone https://github.com/linuxdynasty/awsretry.git\n $ cd awsretry\n $ virtualenv venv\n ...\n $ . venv/bin/activate\n $ pip install -r requirements.txt\n $ pip install -e .\n\nRunning Tests\n-------------\n\nYou can run the tests by using tox which implements nosetest or run them\ndirectly using nosetest.\n\n.. code-block:: sh\n\n $ tox\n $ tox tests/test_awsretry.py\n $ tox -e py27,py36 tests/\n $ nosetest", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/linuxdynasty/awsretry", "keywords": "boto3 aws retry awsretry backoff", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "awsretry", "package_url": "https://pypi.org/project/awsretry/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/awsretry/", "project_urls": { "Homepage": "https://github.com/linuxdynasty/awsretry" }, "release_url": "https://pypi.org/project/awsretry/1.0.2/", "requires_dist": null, "requires_python": null, "summary": "Decorate your AWS Boto3 Calls with AWSRetry.backoff(). This will allows your calls to get around the AWS Eventual Consistency Errors.", "version": "1.0.2" }, "last_serial": 2857047, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "04ceb83347440b34e4043fc068122c8d", "sha256": "2f643f47117694c89bb40c08c991ef50974803d2e4e9e7b5eb7f8bf1543e6f0b" }, "downloads": -1, "filename": "awsretry-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "04ceb83347440b34e4043fc068122c8d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6475, "upload_time": "2017-01-31T13:46:48", "url": "https://files.pythonhosted.org/packages/08/6e/2a45a12e722c629f957a1f52fc167a18a6e308de3134823c2a9a1c1ce62a/awsretry-1.0.1-py2.py3-none-any.whl" } ], "1.0.2": [] }, "urls": [] }