The Client requires the url to the API root and a valid API key. These can be provided in three ways, in order of precedence:
As keyword arguments when instantiating the Client.
Via the ECMWF_DATASTORES_URL and ECMWF_DATASTORES_KEY environment variables.
From a configuration file, which must be located at ~/.ecmwfdatastoresrc or at the path specified by the ECMWF_DATASTORES_RC_FILE environment variable.
>>> collections = client.get_collections(sortby="update")
>>> collection_ids = []
>>> while collections is not None: # Loop over pages
... collection_ids.extend(collections.collection_ids)
... collections = collections.next # Move to the next page
...
>>> collection_ids
[...]
>>> collection_id in collection_ids
True
>>> jobs = client.get_jobs(sortby="-created", status="successful")
>>> request_ids = []
>>> while jobs is not None: # Loop over pages
... request_ids.extend(jobs.request_ids)
... jobs = jobs.next # Move to the next page
...
>>> request_ids
[...]
>>> remote.request_id in request_ids
True
Configure your virtual environment and pre-commit hooks:
make install
[!NOTE]
This project uses uv for dependency management. Commit the generated uv.lock file to version control.
2. Run Quality Assurance
Check formatting, linting, and lockfile consistency:
make qa
3. Commit and Push
Save and push any automatically formatted changes:
git add .
git commit -m "format codebase and sync lockfile"
git push origin HEAD
The CI/CD pipeline triggers on pull requests, merges to main/upstream, and new releases.
Using the Makefile
All development tasks are exposed as self-documenting targets in the Makefile. To see a complete list of available targets and their descriptions, run:
make help
This displays all available utility commands, including:
Environment setup: make install
Quality assurance: make qa
Unit tests: make unit-tests
Type checking: make type-check
To run the full set of quality checks, tests, and build steps in a single command, use:
make all
License
Copyright 2022, European Union.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Alternatives
Use instead of ecmwf-datastores-client: tools that do the same job, closest first.
Use together with ecmwf-datastores-client: extensions, drivers, servers and companion tools.
cfgribPythie’s Index: 34Python interface to map GRIB files to the NetCDF Common Data Model following the CF Convention using ecCodes.859.3K downloads/mo