pyslk.retrieve#
- pyslk.retrieve(resource: str | list | int, dest_dir: str | None = None, recursive: bool = False, group: bool | None = None, delayed: bool = False, **kwargs) str | list #
Retrieve data from tape archive using slk retrieve
If group is True or resource is a list of files, the retrieve calls will be grouped by tape id to optimize retrieve calls. This functions aims at implementing the recommendations of DKRZ for speeding up retrievals.
- Parameters:
resource (
str
,list
orint
) – Path, pattern, SearchID, file or list of files that should be retrieved.dest_dir (
str
) – Destination directory for retrieval. Retrieves to current directory by default.recursive (
bool
) – Retrieve recursively.group (
bool
) – Group files by tape id and make one retrieve call per group. If group is None, retrieve calls will only be grouped if resource is a list of files. To totally avoid grouping, set group to False.delayed (
bool
) – Delay retrieve calls using dask delayed.
- Returns:
StdOut from slk calls. If delayed is True, a list of
dask.delayed.Delayed
objects per tape_id is returned for later (maybe parallel) execution.- Return type:
str
orlist
See also