Download Files with Python
You can download files from a deepset Cloud workspace to a directory on your computer, including the files' metadata.
Prerequisites
- Install the SDK
- Generate an API Key to connect to a deepset Cloud workspace.
Download Files Script Examples
Here's a code to download files, including their metadata, to a local folder called my_files
:
from deepset_cloud_sdk.workflows.sync_client.files import download
download(
api_key="<deepset Cloud API key>",
workspace_name="<your_workspace>",
file_dir=Path("./downloaded_files"),
)
from deepset_cloud_sdk.workflows.async_client.files import download
async def my_async_context() -> None:
await download(
api_key="<deepset Cloud API key>",
workspace_name="<your_workspace>",
file_dir=Path("./downloaded_files"),
)
Updated 5 months ago
Related Links