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-1.2.0.tar.gz
(2.5 kB
view details)
Built Distribution
File details
Details for the file getjson-1.2.0.tar.gz
.
File metadata
- Download URL: getjson-1.2.0.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42ed587ed85da6fd81e1b53ab11634db95d48270fbc80153c9073fb572430c50 |
|
MD5 | 1a1be15314615fff8ca2500d2c0ea3e4 |
|
BLAKE2b-256 | e0f3ca4768467aa844ebd929599e3215c13b23457f6595579bd85817de5891ff |
File details
Details for the file getjson-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: getjson-1.2.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75d19d1efe8b398f6d67d7ed63f9fa305a7ca82d42259008677496780c697cce |
|
MD5 | d1da885dbb31da205e7e98b93b0c66b4 |
|
BLAKE2b-256 | 00f549508170a068bd3530bd4b9f7d99de4ba79eecff24a1b08804960b30b4e4 |