Get last version from Zenodo

Description

This function retrieves the latest version of a file from a Zenodo repository record. It checks the file size and only downloads if the local file is missing or differs from the remote version.

Usage

get_last_version_from_zenodo(doi, pattern, path)

Arguments

doi Character string DOI of the Zenodo record (e.g., "10.5281/zenodo.5794106")
pattern Character string pattern to identify the specific file to download
path Character string local path where the file should be saved

Details

Credit goes partially to https://inbo.github.io/inborutils/ This function handles the new Zenodo API format and file structure.

Value

Character string path to the downloaded file

Examples

library("tima")

get_last_version_from_zenodo(
  doi = "10.5281/zenodo.5794106",
  pattern = "frozen.csv.gz",
  path = "data/frozen.csv.gz"
)