FredrikM97 / grequests

Requests + Gevent = <3

Home Page:https://pypi.python.org/pypi/grequests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GRequests: Asynchronous Requests ===============================

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

version pyversions

Note: You should probably use requests-threads or requests-futures instead.

Usage

Usage is simple:

Create a set of unsent Requests:

Send them all at the same time:

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:

For some speed/performance gains, you may also want to use imap instead of map. imap returns a generator of responses. Order of these responses does not map to the order of the requests you send out. The API for imap is equivalent to the API for map.

Installation

Installation is easy with pip:

$ pip install grequests
✨🍰✨

About

Requests + Gevent = <3

https://pypi.python.org/pypi/grequests

License:BSD 2-Clause "Simplified" License


Languages

Language:Python 100.0%