You only need to go through this procedure once, before you can use the CDS API on macOS.
Prerequisites
- Have a CDS account. If you don't have an account, please self register at the CDS registration page.
Option 1: use Python 2.
Option 2: use Python 3. You are recommended to follow instructions here using Homebrew.
Step-by-step guide
- Login to CDS and copy the 2 line code displayed on this page. The code shows a url and your own uid:API key.
- Paste the 2 line code into a ~/.cdsapirc file. To create this file, run 'touch ~/.cdsapirc' in your Terminal.
- Install the CDS API client using pip: pip install cdsapi (or try pip install --user cdsapi). You should run this under a Terminal.
- Once the CDS API client is installed, it can be used to request data from the datasets listed in the CDS catalogue. It is necessary to agree to the Terms of Use of every datasets that you intend to download. Attached to each dataset download form, the "Show API request" button displays the python code to be used. Examples are also shown here.
If you are getting connection issues, we recommend that in the first instance you check your proxy settings with your local IT team.