Download To Path

async AsyncCogniteClient.files.download_to_path(
path: Path | str,
id: int | None = None,
external_id: str | None = None,
instance_id: NodeId | None = None,
) None

Download a file to a specific target.

Parameters:
  • path (Path | str) – Download to this path.

  • id (int | None) – Id of of the file to download.

  • external_id (str | None) – External id of the file to download.

  • instance_id (NodeId | None) – Instance id of the file to download.

Examples

Download a file by id:
>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> client.files.download_to_path("~/mydir/my_downloaded_file.txt", id=123)