Skip to main content
Version: 25.6

snorkelai.sdk.client.files.download_dir

snorkelai.sdk.client.files.download_dir(remote_path, local_path)

Downloads remote directory from Snorkel Files Store to local directory. Files and subdirectories inside the remote directory will be placed directly in the local directory. Both absolute paths (ex. minio://workspace-1/data_dir) and relative paths (ex. data_dir, workspace-1/data_dir) are supported.

warning
If you’re including the workspace prefix in the remote path, the workspace prefix (workspace-{#}) must match the current workspace. Relative paths will be resolved by removing the workspace prefix: workspace-1/data_dir -> data_dir.

Example

remote_path = "minio://workspace-1/data_dir" # equivalent to "data_dir"
local_path = "/home/user/download_dir"

# Files and sub-directories under `remote_path` will be downloaded to /home/user/download_dir
sf.download_dir(remote_path, local_path)

# To preserve the directory name, you can specify the local path like this:
sf.download_dir(remote_path, "/home/user/download_dir/data_dir")

# These calls will raise a ValueError
sf.download_dir("minio://workspace-{not-current-workspace-id}/data_dir", local_path)
sf.download_dir("workspace-{not-current-workspace-id}/data_dir", local_path)

Parameters

NameTypeDefaultInfo
remote_pathstrPath of remote directory to be downloaded.
local_pathstrLocal directory to download file to.

Return type

None