pyslk.retrieve_raw#
- pyslk.retrieve_raw(path_or_id: str | int | Path, dest_dir: str | Path, partsize: int = -1, streams: int = -1, stats: bool = False, writeblocksize: int = -1, recursive: bool = False, duplicate: bool = False, preserve_path: bool = True, skip_if_exists: bool = False, return_type: int = 0) str | int | CompletedProcess | Popen | None #
Retrieve files via search id or GNS path.
Overwrite files if they already exists. Prevent this by ‘duplicate’ or ‘skip_if_exists’.
- Parameters:
path_or_id (str or int or Path) – search id or gns path of resources to retrieve
dest_dir (str or Path) – destination directory for retrieval
partsize (int) – size of each file to download per stream, Default: 500 (default is used if not >0)
streams (int) – number of file part streams to use per node, Default: 4 (default is used if not >0)
stats (bool) – Display part and I/O stats for each node
writeblocksize (int) – I/O block size for file writes (KB), Default: 4096 (default is used if not >0)
recursive (bool) – use the -R flag to retrieve recursively, Default: False
duplicate (bool) – create a duplicate file if file exists
preserve_path (bool) – preserve namespace in destination [default: True]
skip_if_exists (bool) – Skip if file exists
return_type (int) – select between 0 (== str output), 1 (== exit code), 2 (subprocess output), 3 (running subproc.)
- Returns:
stdout of the slk_helpers call
- Return type:
Union[str, int, subprocess.CompletedProcess, subprocess.Popen] or None
See also