This package provides access to the Climate Data Store (a.k.a. CDS) service.

The CDS website provides a Show API request button at the bottom of the download tab of each dataset. This button generates the code to download the dataset with the Python cdsapi module. We've designed this Julia package so that one could copy/paste the generated Python code with minimum modification in Julia.


Please install the package with Julia's package manager:

] add CDSAPI


Make sure your ~/.cdsapirc file exists. Instructions on how to create the file for your user account can be found here.

Suppose that the Show API request button generated the following Python code:

#!/usr/bin/env python
import cdsapi
c = cdsapi.Client()
"variable": "all",
"product_type": "elevation_change",
"file_version": "20170405",
"format": "tgz"

You can obtain the same results in Julia with the following code:

using CDSAPI

"variable": "all",
"product_type": "elevation_change",
"file_version": "20170405",
"format": "tgz"

We've copied/pasted the code and called the py2ju function on the second argument of the retrieve function. The py2ju function simply converts the string containing a Python dictionary to an actual Julia dictionary.

Besides the downloaded file, the retrieve function also returns a dictionary with the following entries:

Dict{String,Any} with 6 entries:
  "result_provided_by" => "8a3eb001-c8e3-4a9c-8170-28191ebea14b"
  "location"           => ""
  "content_type"       => "application/gzip"
  "request_id"         => "04534ef1-874d-4c81-bb59-9b5effe63e9e"
  "content_length"     => 193660
  "state"              => "completed"