Skip to main content
Version: 25.6

snorkelai.sdk.client.files.upload_dir

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

Uploads a local directory to the Snorkel Files Store. 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

local_path = "/home/user/data_dir"
remote_path = "data_dir"

# Directory will be uploaded to minio://workspace-{current-workspace-id}/data_dir
sf.upload_dir(local_path, remote_path)

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

Parameters

NameTypeDefaultInfo
local_pathstrDirectory containing files to be uploaded.
remote_pathstrRemote directory on Snorkel Files Store to upload files to.

Returns

Tuple containing:
  • List of uploaded file paths

  • Uploaded directory path

Return type

Tuple[List[str], str]