{ "info": { "author": "Stavros Korokithakis", "author_email": "hi@stavros.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "===============================\nRequests Guard\n===============================\n\n.. image:: https://img.shields.io/travis/skorokithakis/requests-guard.svg\n :target: https://travis-ci.org/skorokithakis/requests-guard\n\n.. image:: https://img.shields.io/pypi/v/requests-guard.svg\n :target: https://pypi.python.org/pypi/requests-guard\n\n.. image:: https://readthedocs.org/projects/requests-guard/badge/?version=latest\n :target: https://readthedocs.org/projects/requests-guard/?badge=latest\n :alt: Documentation Status\n\nrequests-guard is a small library that allows you to impose size and time limits on your HTTP requests.\n\n* Free software: BSD license\n* Documentation: https://requests-guard.readthedocs.org.\n\nFeatures\n--------\n\n* Timeout limits\n* Size limits\n* Much more!\n\nInstallation\n------------\n\nJust use `pip` to install it:\n\n```\npip install requests-guard\n```\n\nand you're done.\n\nUsage\n-----\n\n```\nimport requests\nfrom requests_guard import guard\n\nr = requests.get(\"https://www.google.com/\", stream=True, timeout=30)\ncontent = guard(r, max_size=3000, timeout=10)\n```\n\n`requests-guard` will raise a `ValueError` if it receives more than `max_size` data in total, or if the *entire*\nrequest takes more than `timeout` seconds to be completed. That means that the call will always return after (roughly,\nsee below for details) `timeout` seconds.\n\n*Note:* You *must* call requests in the manner above, with `stream=True` and `timeout`. `stream=True` allows the size\nand time limits to be set, and the `timeout` parameter to `requests` instructs it to close the connection if no data\nhas been received for that number of seconds.\n\n*Note:* `requests-guard` works by looking at the data as it receives it, so the `timeout` parameter to `requests-guard`\nwill apply to the *entire* connection, not just the latest chunk. The `timeout` parameter to `requests` means \"quit if\nwe haven't received any data for that long\", which means that a response may take an arbitrary amount of time, as long\nas it always returns *something* every `timeout` seconds. This means that a request may potentially take up to the sum\nof the timeout specified to `requests` and to `requests-guard`, if the server stops replying completely just before\nthe timeout in `requests-guard` elapses.\n\n\n\n\n\nHistory\n-------\n\n0.1.0 (2015-03-04)\n---------------------\n\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/skorokithakis/requests-guard", "keywords": "requests-guard", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "requests-guard", "package_url": "https://pypi.org/project/requests-guard/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/requests-guard/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/skorokithakis/requests-guard" }, "release_url": "https://pypi.org/project/requests-guard/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "requests-guard is a small library that allows you to impose size and time limits on your HTTP requests.", "version": "0.1.0" }, "last_serial": 1458158, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "52112ab265cb12d8b7bacf57a11d6d89", "sha256": "ab2854402af57bf7a116c610e0facce56a67828224e955426bae8e7b5c400171" }, "downloads": -1, "filename": "requests_guard-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "52112ab265cb12d8b7bacf57a11d6d89", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4941, "upload_time": "2015-03-12T02:52:15", "url": "https://files.pythonhosted.org/packages/74/15/2a097a38e8c61bcce777649fd289ade8f07ef6749777369fd620a3c1f09b/requests_guard-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d2a60d51fc11ec0a74c55a774da1f5de", "sha256": "1076f985a68e918aae9e438848297ed959a825f23a29f5f7a05b5b58afee13be" }, "downloads": -1, "filename": "requests-guard-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d2a60d51fc11ec0a74c55a774da1f5de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5538, "upload_time": "2015-03-12T02:52:12", "url": "https://files.pythonhosted.org/packages/9a/88/b4ea639af03416659dc340c813cd204bcd608e94b0bf7a2c750499c9c60f/requests-guard-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "52112ab265cb12d8b7bacf57a11d6d89", "sha256": "ab2854402af57bf7a116c610e0facce56a67828224e955426bae8e7b5c400171" }, "downloads": -1, "filename": "requests_guard-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "52112ab265cb12d8b7bacf57a11d6d89", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4941, "upload_time": "2015-03-12T02:52:15", "url": "https://files.pythonhosted.org/packages/74/15/2a097a38e8c61bcce777649fd289ade8f07ef6749777369fd620a3c1f09b/requests_guard-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d2a60d51fc11ec0a74c55a774da1f5de", "sha256": "1076f985a68e918aae9e438848297ed959a825f23a29f5f7a05b5b58afee13be" }, "downloads": -1, "filename": "requests-guard-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d2a60d51fc11ec0a74c55a774da1f5de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5538, "upload_time": "2015-03-12T02:52:12", "url": "https://files.pythonhosted.org/packages/9a/88/b4ea639af03416659dc340c813cd204bcd608e94b0bf7a2c750499c9c60f/requests-guard-0.1.0.tar.gz" } ] }