xnn.common.models.hub.zenodo.fetch_record#

xnn.common.models.hub.zenodo.fetch_record(recid, root, *, refresh=False, offline=False)[source]#

Return a record’s metadata, caching it as <root>/record.json.

Parameters:
  • recid (str) – Zenodo record id.

  • root (pathlib.Path) – Cache directory of this record.

  • refresh (bool, optional) – Ask the API again even when the metadata is cached.

  • offline (bool, optional) – Never touch the network; the metadata must be cached already.

Returns:

The record JSON.

Return type:

dict

Raises:

FileNotFoundError – Offline with no cached metadata.