Welcome to cognite-cdffs’s documentation!

A file-system interface (cdffs) that allow users to work with CDF (Cognite Data Fusion) Files using fsspec supported/compatible python packages (pandas, xarray etc). cdffs uses cognite-sdk-python to work with CDF Files.

Refer fsspec documentation to get the list of all supported/compatible python packages.

Installation

To install this package:

pip install cognite-cdffs

Quickstart

Important steps to follow when working with CDF Files using the fsspec supported python packages.

  1. Import cdffs package

from cognite import cdffs
  1. Follow instructions from Authentication to authenticate.

  2. Read/write the files from/to CDF using fsspec supported packages.

Read zarr files using using xarray. (Environment variables are used to authenticate)

ds = xarray.open_zarr("cdffs://sample_data/test.zarr")

Write zarr files using xarray.

metadata = FileMetadata(source="sample", data_set_id=1234567890)
ds.to_zarr("cdffs://sample_data/test.zarr", storage_options={"file_metadata": metadata})

Contents