{ "info": { "author": "Joshua Carp", "author_email": "jm.carp@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT 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": "requests-middleware\n===================\n\n.. image:: https://badge.fury.io/py/requests-middleware.png\n :target: http://badge.fury.io/py/requests-middleware\n\n.. image:: https://travis-ci.org/jmcarp/requests-middleware.png?branch=master\n :target: https://travis-ci.org/jmcarp/requests-middleware\n\n*TL;DR*: **requests-middleware** is a custom transport adapter that allows simple\ncomposition of HTTP interactions.\n\nThe `python-requests`_ library makes excellent use of transport adapters to\nallow for easy extension and modification of HTTP interactions. There are\nadapters for SSL configuration, rate-limiting, and testing, and writing your\nown adapters is easy.\n\nBut what if you want to use more than one of those behaviors for the same\nsession? What if you want HTTP caching *and* rate-limiting? Requests only\nuses one adapter per URL. You could write a new\n`CachingRateLimitingHTTPAdapter`, but that's probably not the best solution.\n\n**requests-middleware** is an effort to preserve the modularity of adapters,\nwhile allowing simple composition of multiple types of interaction. Want to\nuse HTTP caching, respect robots.txt files, and limit your application to\n10 requests per hour? No problem!\n\n.. code-block:: python\n\n import requests\n from requests_middleware import MiddlewareHTTPAdapter\n from requests_middleware.contrib.cacheware import CacheMiddleware\n from requests_middleware.contrib.robotware import RobotsMiddleware\n from requests_middleware.contrib.throttleware import \\\n ThrottleMiddleware, RequestsPerHourThrottler\n\n session = requests.Session()\n middlewares = [\n CacheMiddleware(),\n RobotsMiddleware(),\n ThrottleMiddleware(RequestsPerHourMiddleware(10)),\n ]\n adapter = MiddlewareHTTPAdapter(middlewares)\n session.mount('http://', adapter)\n session.mount('https://', adapter)\n\n.. _python-requests: https://github.com/kennethreitz/requests\n.. _httpcache: https://github.com/Lukasa/httpcache", "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/jmcarp/requests-middleware", "keywords": null, "license": "Copyright 2014 Joshua Carp\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "requests-middleware", "package_url": "https://pypi.org/project/requests-middleware/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/requests-middleware/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jmcarp/requests-middleware" }, "release_url": "https://pypi.org/project/requests-middleware/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "Composable HTTP middleware for requests", "version": "0.1.2" }, "last_serial": 1805861, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7f0434efdd67dab32d9781481ecafa7f", "sha256": "c97a4b85abc874d02a8b8ace311d5c4169ad2b82dd572ee2cd6a4e555aa6d899" }, "downloads": -1, "filename": "requests-middleware-0.1.0.tar.gz", "has_sig": false, "md5_digest": "7f0434efdd67dab32d9781481ecafa7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5677, "upload_time": "2014-07-11T02:14:05", "url": "https://files.pythonhosted.org/packages/ef/ff/9cbe8fb297d924f6de4e4d6b595d5b91433b4c8f88e0361b8bcc083ca3ac/requests-middleware-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "aa0239326f5f6578603573d1c9bc2ed1", "sha256": "d001eb0ee69e9dd594a2b3085cca47b212c5894e46b493dbf210495f5c2bb7b2" }, "downloads": -1, "filename": "requests-middleware-0.1.1.tar.gz", "has_sig": false, "md5_digest": "aa0239326f5f6578603573d1c9bc2ed1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6853, "upload_time": "2014-07-30T20:12:49", "url": "https://files.pythonhosted.org/packages/b7/a0/2e489f3bcb60a3e0e4f041a8f2403bd776d014840e2b6dc753c5158c5900/requests-middleware-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a85e61fb76d1ce7a4640845e25a5dd5e", "sha256": "ced0d7af9b41888c41cf3e282a56c280c9912e0ed019571122f98a78380c4c6c" }, "downloads": -1, "filename": "requests_middleware-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a85e61fb76d1ce7a4640845e25a5dd5e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11108, "upload_time": "2015-11-07T17:26:41", "url": "https://files.pythonhosted.org/packages/18/7f/f140dfefd30f02ea25fd8afbf7a2c4142ed8d1b3217d915f4d76ff1fd897/requests_middleware-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e90ecd462edf80899c1b5c1067aa269", "sha256": "97b888d2feccaab3359c74ef884b15c4494b57798e4f73cd541eb67cf1061094" }, "downloads": -1, "filename": "requests-middleware-0.1.2.tar.gz", "has_sig": false, "md5_digest": "1e90ecd462edf80899c1b5c1067aa269", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6970, "upload_time": "2015-11-07T17:26:47", "url": "https://files.pythonhosted.org/packages/61/03/4c349d57ffb43d6c41cb1843acbd1f7867e3af941b8db1dd771a42ca4150/requests-middleware-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a85e61fb76d1ce7a4640845e25a5dd5e", "sha256": "ced0d7af9b41888c41cf3e282a56c280c9912e0ed019571122f98a78380c4c6c" }, "downloads": -1, "filename": "requests_middleware-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a85e61fb76d1ce7a4640845e25a5dd5e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11108, "upload_time": "2015-11-07T17:26:41", "url": "https://files.pythonhosted.org/packages/18/7f/f140dfefd30f02ea25fd8afbf7a2c4142ed8d1b3217d915f4d76ff1fd897/requests_middleware-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e90ecd462edf80899c1b5c1067aa269", "sha256": "97b888d2feccaab3359c74ef884b15c4494b57798e4f73cd541eb67cf1061094" }, "downloads": -1, "filename": "requests-middleware-0.1.2.tar.gz", "has_sig": false, "md5_digest": "1e90ecd462edf80899c1b5c1067aa269", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6970, "upload_time": "2015-11-07T17:26:47", "url": "https://files.pythonhosted.org/packages/61/03/4c349d57ffb43d6c41cb1843acbd1f7867e3af941b8db1dd771a42ca4150/requests-middleware-0.1.2.tar.gz" } ] }