Download To Path

async AsyncCogniteClient.data_modeling.files.download_to_path(
path: Path,
node_id: NodeId | tuple[str, str],
) None

Download a file to a specific path by instance ID.

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

  • node_id (NodeId | tuple[str, str]) – Instance ID of the file to download.

Examples

Download a file by instance ID:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes.data_modeling import NodeId
>>> client = CogniteClient()
>>> client.data_modeling.files.download_to_path(
...     Path("~/mydir/my_file.txt"), NodeId("my-space", "my-file")
... )