You can use requests
still, just not rely on the response object to do the decoding for you:
import json
# ...
data = json.loads(req.content)
return int(data['statistics']['dataCount'])
Version 0.8.2 is ancient; you can use virtualenv
to create a location for you to install a newer version instead:
$ virtualenv venv
New python executable in venv/bin/python2.7
Also creating executable in venv/bin/python
Installing Setuptools..............................................................................................................................................................................................................................done.
Installing Pip.....................................................................................................................................................................................................................................................................................................................................done.
$ cd venv/
$ bin/pip install requests
Downloading/unpacking requests
Downloading requests-2.2.1.tar.gz (421kB): 421kB downloaded
Running setup.py egg_info for package requests
Installing collected packages: requests
Running setup.py install for requests
Successfully installed requests
Cleaning up...
$ bin/python -c 'import requests; print requests.__version__'
2.2.1