Python HTTP Requests for the Lazy.
Python Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
requirements
.gitignore
Guardfile
LICENSE
Makefile
README
response.py
test.py

README

 _ __ ___  ___ _ __   ___  _ __  ___  ___   _ __  _   _
| '__/ _ \/ __| '_ \ / _ \| '_ \/ __|/ _ \ | '_ \| | | |
| | |  __/\__ \ |_) | (_) | | | \__ \  __/_| |_) | |_| |
|_|  \___||___/ .__/ \___/|_| |_|___/\___(_) .__/ \__, |
              |_|                          |_|    |___/

-----
What?
-----

Response extends the excelent Requests library by Kenneth Reitz to save
you some typing.

----
How?
----

Instead of having to explicitly assign the response of a request to a named
local variable, response.py converts the Requests HTTP request methods to
context managers in which context the thread local variable response is
the current response. The context managers can be nested together as the
responses are stacked together.

-------------
Cough... How?
-------------

from response import get, response

api = lambda path: 'https://api.github.com' + path

with get(api('/repos/gsamokovarov/frames.py/contributors')):
    for metadata in response.json:
        print '%(login)s: %(contributions)d commits' % metadata