scverse_misc.datasets.fetch

Contents

scverse_misc.datasets.fetch#

scverse_misc.datasets.fetch(entry, cache_dir, *, base_url=None, retries=3, **kwargs)#

Download (if needed) and load entry, dispatching to the loader registered for entry.type.

Files are cached under cache_dir / entry.type.

Parameters:
  • entry (DatasetEntry) – File to download.

  • cache_dir (str | Path) – Directory to download to.

  • base_url (str | None (default: None)) – The base URL.

  • retries (int (default: 3)) – Number of attempts before failure.

  • **kwargs (object) – Passed to the loader.

Return type:

TypeVar(T)

Returns:

The absolte path of the downloaded file.