mr2.phantoms.a4im_lowfield.download_zenodo_files

mr2.phantoms.a4im_lowfield.download_zenodo_files(record: int | str, filenames: str | Sequence[str], output_directory: str | PathLike, *, progress: bool = False, verify: bool = False) → Path[source]

Download, checksum-verify and extract selected Zenodo files.

Completed files are cached by record and archive checksum. Cache hits check member sizes; verify=True also checks extracted file SHA256 hashes. Metadata is fetched on each call. Local datasets remain usable offline. Downloads and extraction use a private staging directory. Files are installed before the manifest is atomically published, so incomplete installs are retried. Concurrent downloads into the same output directory fail with FileExistsError. After forcibly terminating a process, remove the .mr2-downloads/lock directory before retrying. Ordinary exceptions clean up staging and the lock.

Parameters:
  • record (int | str) – Zenodo record identifier.

  • filenames (str | Sequence[str]) – Filename or filenames from the record to download.

  • output_directory (str | PathLike) – Directory in which to extract or store the files.

  • progress (bool, default: False) – Show byte-level download progress.

  • verify (bool, default: False) – Verify hashes as well as sizes of cached extracted files.