neuralfetch.download.BaseDownload

pydantic model neuralfetch.download.BaseDownload[source][source]

Abstract base class for all neuralfetch download backends.

Subclasses must implement _download(). The public download() method wraps _download with idempotency checks via a success file: once a dataset has been downloaded successfully, subsequent calls are no-ops unless overwrite=True is passed.

Selective downloading is unified across backends via the include and exclude glob fields (dataset-relative POSIX globs). include empty means “everything”; exclude is applied after include and wins. Backends map these onto their native selection mechanism where possible (see _selects()); backends with no usable native filter raise NotImplementedError when either field is set (see _reject_selection_filters()).

Parameters:
  • study (str) – Dataset identifier (e.g. a Dandiset ID, Zenodo record, or study name).

  • dset_dir (PathLike) – Root directory for the study. The parent must already exist; this directory and the folder/ sub-directory are created automatically.

  • folder (str) – Name of the sub-directory inside dset_dir where raw files land. Defaults to "download".

Fields:
field study: str [Required][source]
field dset_dir: str | Path [Required][source]
field folder: str = 'download'[source]
field include: list[str] = [][source]
field exclude: list[str] = [][source]
get_success_file() → Path[source][source]
final download(overwrite: bool = False) → None[source][source]
requirements: tp.ClassVar[tuple[str, ...]] = ()[source]