ECMWF Data Stores Service (DSS) API Python Client

0.5.1 · active · verified Tue Apr 14

The `ecmwf-datastores-client` is a Python library providing programmatic access to the ECMWF Data Stores Service (DSS) API. It allows users to interact with data catalogues like the Climate Data Store (CDS), Atmosphere Data Store (ADS), and Early Warning Data Store (EWDS) for metadata retrieval, synchronous or asynchronous job submission, and data download. Currently at version 0.5.1, it is in an 'Incubating' state, implying a mostly stable interface but with a readiness for incoming changes.

Warnings

Install

Imports

Quickstart

Initializes the `ecmwf-datastores-client` and demonstrates how to configure it using environment variables for API URL and key. It also includes commented-out examples for checking authentication and listing data collections, which require a valid API key and URL.

import os
from ecmwf.datastores import Client

# Configure API key and URL via environment variables for a runnable example
# Alternatively, pass 'url' and 'key' as keyword arguments to Client()
# or use a configuration file (~/.ecmwfdatastoresrc).

client = Client(
    url=os.environ.get('ECMWF_DATASTORES_URL', 'https://data-stores.ecmwf.int/api'),
    key=os.environ.get('ECMWF_DATASTORES_KEY', '')
)

# Optional: verify authentication (requires a valid key/url)
# try:
#     client.check_authentication()
#     print("Authentication successful!")
# except Exception as e:
#     print(f"Authentication failed: {e}")

# Example: List available collections (requires authentication and access rights)
# try:
#     collections = client.list_collections()
#     for collection in collections:
#         print(f"Collection ID: {collection.id}, Title: {collection.title}")
# except Exception as e:
#     print(f"Could not list collections: {e}")

view raw JSON →