Request JSON data en masse with backoff and failover
Project description
getjson
A micro-package for retrieving JSON data, en masse potentially, with backoff and failover
Install
pip install getjson
Usage
data_or_none = getjson.getjson('https://config.microprediction.com/config.json')
Usage w/ failover
data_or_none = getjson.getjson('https://config.microprediction.com/config.json','https://stableconfig.microprediction.com/config.json')
Multiple urls
urls = ['http://api.microprediction.org/lagged/traffic_absolute_speed.json','https://api.microprediction.org/lagged/die.json']
data = getjson.mgetjson(urls=urls)
Multiple urls with failover
urls = ['http://api.microprediction.org/lagged/traffic_absolute_speed.json','https://api.microprediction.org/lagged/die.json']
failover_urls = ['http://stableapi.microprediction.org/lagged/traffic_absolute_speed.json','https://stableapi.microprediction.org/lagged/die.json']
data = getjson.mgetjson(urls=urls, failover_urls=failover_urls)
Dude, what's microprediction?
New video tutorials are available at https://www.microprediction.com/python-1 to help you get started running crawlers at www.microprediction.com and win $50,000.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
getjson-2.0.0.tar.gz
(2.2 kB
view details)
Built Distribution
File details
Details for the file getjson-2.0.0.tar.gz
.
File metadata
- Download URL: getjson-2.0.0.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ed740717046da068a87cf383ee2bd5ace75d2a167a654651e2fa1a883d23cf8 |
|
MD5 | c52adae4229fe888c709c7e90d506c49 |
|
BLAKE2b-256 | 22035edf11c4f30c84df84f5eb7f24fd921c47a1350338cc30ab048ea2e94c0f |
File details
Details for the file getjson-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: getjson-2.0.0-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1de9e8dd0864c32fdf07c0b4a9c056f9506aaddb9d745a4f38079b9df1ec3b1 |
|
MD5 | eafe2020733765e7b038691cb2cff259 |
|
BLAKE2b-256 | 2b9aca8085f270202ba165f7fcab8c1ce183aff1fff38ef023d17d17fd082bfa |