ZenodoRecord

class ZenodoRecord(conceptrecid)[source]

Bases: object

Helper for querying all versions of a Zenodo concept record.

The class fetches all versions for a given conceptrecid from the Zenodo records API and exposes convenience methods for version lookup and file metadata extraction.

Methods

__init__

Initialize a record client for a Zenodo concept record id.

get_all_version_ids

Return the list of record ids for all available versions.

get_all_versions

Return all version records returned by the Zenodo API query.

get_file_links

Return download links for all files in a version.

get_filenames

Return file names for all files in a version.

get_latest_version

Return the record marked as the latest version.

get_latest_version_id

Return the Zenodo record id of the latest version.

get_version

Return a specific version record by its record id.

__init__(conceptrecid)[source]

Initialize a record client for a Zenodo concept record id.

Parameters:

conceptrecid – Zenodo concept record id shared by all versions of the record.

get_all_version_ids() List[str][source]

Return the list of record ids for all available versions.

get_all_versions() List[Dict][source]

Return all version records returned by the Zenodo API query.

Return download links for all files in a version.

Parameters:

id – Zenodo record id of the target version.

get_filenames(id: int) List[str][source]

Return file names for all files in a version.

Parameters:

id – Zenodo record id of the target version.

get_latest_version() Dict[source]

Return the record marked as the latest version.

Raises:

Exception – If no record is marked as latest in the API response.

get_latest_version_id() int[source]

Return the Zenodo record id of the latest version.

get_version(id: int) Dict[source]

Return a specific version record by its record id.

Parameters:

id – Zenodo record id of the target version.

Raises:

Exception – If no record with the given id is found.