colour_datasets.utilities.json_open#
- colour_datasets.utilities.json_open(url: str, retries: int = 3) Dict [source]#
Open given url and return its content as JSON.
- Parameters
- Returns
JSON data.
- Return type
- Raises
urllib.error.URLError, ValueError – If the url cannot be opened or parsed as JSON.
Notes
The definition caches the request JSON output for 5 minutes.
Examples
# Doctests skip for Python 2.x compatibility. >>> json_open(”https://zenodo.org/api/records/3245883”) … # doctest: +SKIP ‘{“conceptdoi”:”10.5281/zenodo.3245882”’