Metadata-Version: 1.1
Name: requests-middleware
Version: 0.1.1
Summary: Composable HTTP middleware for requests
Home-page: https://github.com/jmcarp/requests-middleware
Author: Joshua Carp
Author-email: jm.carp@gmail.com
License: Copyright 2014 Joshua Carp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Description: requests-middleware
        ===================
        
        .. image:: https://badge.fury.io/py/requests-middleware.png
            :target: http://badge.fury.io/py/requests-middleware
        
        .. image:: https://travis-ci.org/jmcarp/requests-middleware.png?branch=master
            :target: https://travis-ci.org/jmcarp/requests-middleware
        
        *TL;DR*: **requests-middleware** is a custom transport adapter that allows simple
        composition of HTTP interactions.
        
        The `python-requests`_ library makes excellent use of transport adapters to
        allow for easy extension and modification of HTTP interactions. There are
        adapters for SSL configuration, rate-limiting, and testing, and writing your
        own adapters is easy.
        
        But what if you want to use more than one of those behaviors for the same
        session? What if you want HTTP caching *and* rate-limiting? Requests only
        uses one adapter per URL. You could write a new
        `CachingRateLimitingHTTPAdapter`, but that's probably not the best solution.
        
        **requests-middleware** is an effort to preserve the modularity of adapters,
        while allowing simple composition of multiple types of interaction. Want to
        use HTTP caching, respect robots.txt files, and limit your application to
        10 requests per hour? No problem!
        
        .. code-block:: python
        
            import requests
            from requests_middleware import MiddlewareHTTPAdapter
            from requests_middleware.contrib.cacheware import CacheMiddleware
            from requests_middleware.contrib.robotware import RobotsMiddleware
            from requests_middleware.contrib.throttleware import \
                ThrottleMiddleware, RequestsPerHourThrottler
        
            session = requests.Session()
            middlewares = [
                CacheMiddleware(),
                RobotsMiddleware(),
                ThrottleMiddleware(RequestsPerHourMiddleware(10)),
            ]
            adapter = MiddlewareHTTPAdapter(middlewares)
            session.mount('http://', adapter)
            session.mount('https://', adapter)
        
        .. _python-requests: https://github.com/kennethreitz/requests
        .. _httpcache: https://github.com/Lukasa/httpcache
        
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
