Project: grequests

Requests + Gevent

Project Details

Latest version
0.7.0
Home Page
https://github.com/spyoungtech/grequests
PyPI Page
https://pypi.org/project/grequests/

Project Popularity

PageRank
0.0026318415724405834
Number of downloads
296349

GRequests allows you to use Requests with Gevent to make asynchronous HTTP Requests easily.

Usage

Usage is simple::

import grequests

urls = [
    'http://www.heroku.com',
    'http://tablib.org',
    'http://httpbin.org',
    'http://python-requests.org',
    'http://kennethreitz.com'
]

Create a set of unsent Requests::

>>> rs = (grequests.get(u) for u in urls)

Send them all at the same time::

>>> grequests.map(rs)
[<Response [200]>, <Response [200]>, <Response [200]>, <Response [200]>, <Response [200]>]