EDIT 2016-03-22: Apologize for the selfishness.
Current Answer
The following snippet is what I applied to fully replace pycurl
using python-requests
. In short, simply supply with stream=True
argument.
import requests
def tide_on(url):
r = requests.get(url, stream=True, **kwargs)
for line in r.iter_lines():
# wish to stop after consuming just one line
print(line)
break
r.close()
Previous "Answer"
The current version of requests
at the time of speaking really made it easy to implement what I asked. Huge thanks to the team behind requests
!
I fully replaced PycURL
with requests
in tidehunter
since version 1.0 and it's working great!
Thanks again to all the comments above :)