cdf data download command to download data from Cognite Data Fusion (CDF) to your local machine. This command provides multiple subcommands for downloading different types of data, including raw tables, assets, time series, events, files, hierarchies, instances, and charts.
All subcommands have an interactive prompt if you do not specify any arguments, making it easy to select what you want to download.
Prerequisites
Before downloading data, ensure you have:- Installed and configured the Cognite Toolkit.
- Authenticated with CDF using appropriate credentials.
- Read permissions for the data you want to download.
- Sufficient disk space for the downloaded files.
Download data
1
Run the interactive download
To download data interactively, run the command for your specific data type without arguments. For example, for raw tables:Follow the prompts to select which raw tables you want to download.
2
Specify resources directly (optional)
Alternatively, you can specify the resources directly in the command line. For example, to download specific tables from a database:
Supported data types
The following data types are currently supported for download:- Raw tables
- Assets
- Time series
- Events
- Files, including file content
- Hierarchies (assets, events, time series, and files)
- Instances
- Charts
- Canvases
- Datapoints
- Records
cdf data download accepts --api-format response to write the API response format. The default is request. cdf data download instances accepts --include-edges to include edges connected to the downloaded nodes.
For an up-to-date list of available data types and their arguments, use the cdf data download --help command.
Download datapoints
cdf data download datapoints downloads the datapoints of the time series in a data set. Pass the data set external ID as the argument, and use --data-type to choose numeric (default) or string:
CogniteTimeSeries in an instance space instead, use --instance-space. State time series require --instance-space and --data-type state. Both options require Cognite Toolkit v0.9.112 or later and the extend-download alpha flag:
--start-timeand--end-timeset the time range. Each accepts an ISO 8601 timestamp, milliseconds since epoch, or a relative time such as1d-ago. Timestamps without a time zone are UTC. From Cognite Toolkit v0.9.112, the command downloads all datapoints from 1900 to 2099 by default, including datapoints with a Bad or Uncertain status.--limitsets the maximum number of time series. The default is1000. Use-1to download all time series.