pudl.scripts.update_zenodo_dois#

Script to check each DOI in zenodo_dois.yml against Zenodo’s /versions/latest endpoint.

If there is a more current DOI, update to the latest one. This can be used to avoid having to hand-update DOI values, and eventually to auto-update records that don’t require hand mapping to extract in PUDL.

Attributes#

Functions#

get_latest_record_id(→ tuple[str | None, str | None])

Get ID of the latest version of any Zenodo record.

update_yaml_dois(→ dict[str, dict])

Check all DOIs and update to latest record versions.

main(datasets)

Auto-update Zenodo DOIs to the latest value.

Module Contents#

pudl.scripts.update_zenodo_dois.logger[source]#
pudl.scripts.update_zenodo_dois.get_latest_record_id(record_id: str) tuple[str | None, str | None][source]#

Get ID of the latest version of any Zenodo record.

Given the ID of any Zenodo record, this will return the record ID and DOI of the latest version associated with the same concept DOI.

pudl.scripts.update_zenodo_dois.update_yaml_dois(yaml_file: pathlib.Path, datasets: tuple[str, Ellipsis]) dict[str, dict][source]#

Check all DOIs and update to latest record versions.

pudl.scripts.update_zenodo_dois.main(datasets: tuple[str, Ellipsis])[source]#

Auto-update Zenodo DOIs to the latest value.