skip to navigation
skip to content

grequests 0.3.0

Requests + Gevent

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


Usage is simple:

import grequests

urls = [

Create a set of unsent Requests:

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

Send them all at the same time:

[<Response [200]>, <Response [200]>, <Response [200]>, <Response [200]>, None, <Response [200]>]

Optionally, in the event of a timeout or any other exception during the connection of the request, you can add an exception handler that will be called with the request and exception inside the main thread:

>>> def exception_handler(request, exception):
...    print "Request failed"

>>> reqs = [
...    grequests.get('', timeout=0.001),
...    grequests.get('http://fakedomain/'),
...    grequests.get('')]
>>>, exception_handler=exception_handler)
Request failed
Request failed
[None, None, <Response [500]>]


Installation is easy with pip:

$ pip install grequests
File Type Py Version Uploaded on Size
grequests-0.3.0.tar.gz (md5) Source 2016-01-31 3KB