corneto.datasets.fetch_dataset#

corneto.datasets.fetch_dataset(name, version='v1', *, source_dir=None, data_home=None, auto_download=True)#

Locate or fetch a versioned CORNETO dataset.

Local repository data takes precedence over the persistent cache and the configured remote source. Dataset files are validated by SHA-256 before they are returned.

Parameters:
  • name (str) – Registered dataset name.

  • version (str) – Immutable dataset revision. Defaults to "v1".

  • source_dir (Path | str | None) – Optional directory containing dataset directories, or a repository root containing a datasets directory.

  • data_home (Path | str | None) – Optional persistent cache directory.

  • auto_download (bool) – Whether to fetch a missing dataset from its remote URL.

Returns:

The path containing the validated dataset files.

Raises:
  • DatasetIntegrityError – If available data do not match their checksums.

  • DatasetError – If no local data exists and the dataset has no remote URL.

  • FileNotFoundError – If data are missing and auto_download is false.

  • ValueError – If the dataset revision is not registered.

Return type:

Path