Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

Download Files with Python

You can download files from a Haystack Platform workspace to a directory on your computer, including the files' metadata. Metadata are downloaded as separate JSON files with the meta.json suffix.


Prerequisites​

  1. Install the SDK.
  2. Generate an API key to connect to a 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 API key>",
workspace_name="<your_workspace>",
file_dir=Path("./downloaded_files"),
)