michaelhelmick/python-mailsnake — pull request #16 by seansawyer (2012-12-20 17:02:55+00:00)
Title: Streamed response support

Instance-level reimplementation of [#15](https://github.com/michaelhelmick/python-mailsnake/pull/15)

Adds support for streamed responses (potentially very large ones from the export API, for example) by modifying MailSnake.__init__() to accept a new kwarg requests_opts that is passed through to requests.post() on each request. If `'stream': True` or `'prefetch': False` is present in requests_opts, MailSnake.call() returns a generator that yields each (deserialized) line as it arrives.

Tested in Python 2.7.3 and 3.2.3 against Requests 0.14.2 and 1.0.3.