dandi.download¶
Functions
Classes
|
An enumeration. |
|
|
|
An enumeration. |
|
An enumeration. |
|
|
|
|
A helper "structure" to accumulate information about assets to be downloaded |
|
Helper for PYOUT styling |
|
|
An enumeration. |
|
- class dandi.download.DLState(value)¶
An enumeration.
- DONE = 5¶
- DOWNLOADING = 2¶
- ERROR = 4¶
- SKIPPED = 3¶
- STARTING = 1¶
- class dandi.download.DownloadDirectory(filepath: str | Path, digests: dict[str, str])[source]¶
-
- digests¶
Expected hashes of the downloaded data, as a mapping from algorithm names to digests
- dirpath¶
The working directory in which downloaded data will be temporarily stored
- filepath¶
The path to which to save the file after downloading
- offset: int | None¶
How much of the data has been downloaded so far
- class dandi.download.DownloadExisting(value)[source]¶
An enumeration.
- ERROR = 'error'¶
- OVERWRITE = 'overwrite'¶
- OVERWRITE_DIFFERENT = 'overwrite-different'¶
- REFRESH = 'refresh'¶
- SKIP = 'skip'¶
- class dandi.download.DownloadFormat(value)[source]¶
An enumeration.
- DEBUG = 'debug'¶
- PYOUT = 'pyout'¶
- class dandi.download.DownloadProgress(downloaded: 'int' = 0, size: 'int | None' = None)[source]¶
- downloaded: int = 0¶
- size: int | None = None¶
- class dandi.download.ItemsSummary[source]¶
A helper “structure” to accumulate information about assets to be downloaded
To be used as a callback to IteratorWithAggregation
- class dandi.download.PYOUTHelper[source]¶
Helper for PYOUT styling
Provides aggregation callbacks for PyOUT and also an iterator to be wrapped around iterating over assets, so it would get “totals” as soon as they are available.
- class dandi.download.ProgressCombiner(zarr_size: 'int', file_qty: 'int | None' = None, downloading: 'dict[str, DownloadProgress]' = <factory>, total_downloaded: 'int' = 0, maxsize: 'int' = 0, prev_status: 'str' = '', yielded_size: 'bool' = False, file_states: 'Counter[DLState]' = <factory>, files_fed: 'int' = 0)[source]¶
- downloading: dict[str, DownloadProgress]¶
- file_qty: int | None = None¶
- files_fed: int = 0¶
- maxsize: int = 0¶
Total size of all files that were not skipped and did not error out during download
- prev_status: str = ''¶
- total_downloaded: int = 0¶
The total number of bytes downloaded so far, including all files currently downloading, skipped, or finished downloading (even if the checksum check failed)
- yielded_size: bool = False¶
- zarr_size: int¶
- dandi.download.download(urls: str | Sequence[str], output_dir: str | Path, *, format: DownloadFormat = DownloadFormat.PYOUT, existing: DownloadExisting = DownloadExisting.ERROR, jobs: int = 1, jobs_per_zarr: int | None = None, get_metadata: bool = True, get_assets: bool = True, preserve_tree: bool = False, sync: bool = False, path_type: PathType = PathType.EXACT) None [source]¶