{"id":23649,"library":"earthkit-data","title":"earthkit-data","description":"A format-agnostic Python interface for geospatial data, providing unified access to GRIB, NetCDF, ODB, and other formats. Current version is 0.19.4, with a release cadence of approximately monthly. A release candidate for 1.0.0 (1.0.0rc1) is available.","status":"active","version":"0.19.4","language":"python","source_language":"en","source_url":"https://github.com/ecmwf/earthkit-data","tags":["geospatial","meteorology","GRIB","NetCDF","data-access"],"install":[{"cmd":"pip install earthkit-data","lang":"bash","label":"Install from PyPI"},{"cmd":"conda install -c conda-forge earthkit-data","lang":"bash","label":"Install via conda-forge"}],"dependencies":[{"reason":"Required for GRIB support","package":"eccodes","optional":true},{"reason":"Alternative GRIB engine","package":"cfgrib","optional":true},{"reason":"Required for NetCDF support","package":"netcdf4","optional":true}],"imports":[{"note":"Most examples use 'import earthkit.data as ekd'; 'from earthkit import data' also works but can cause confusion.","wrong":"from earthkit import data","symbol":"earthkit.data","correct":"import earthkit.data as ekd"},{"note":"Low-level core classes are not part of the public API; use from_source instead.","wrong":"from earthkit.data.core import Base","symbol":"realize","correct":"from earthkit.data import from_source"}],"quickstart":{"code":"import earthkit.data as ekd\n\n# Load GRIB data from a URL\nds = ekd.from_source(\"url\", \"https://get.ecmwf.int/repository/test-data/earthkit-data/example.grib\")\n\n# Inspect metadata\nprint(ds[0].metadata(\"param\"))\n\n# Convert to xarray\nxr_ds = ds.to_xarray()\nprint(xr_ds)","lang":"python","description":"Load a GRIB file from a URL and convert to xarray."},"warnings":[{"fix":"Refer to the upgrade guide at https://earthkit-data.readthedocs.io/en/latest/release-notes/version_1.0.0rc_updates.html","message":"Version 1.0.0rc1 introduces breaking changes: the API for metadata access and data conversion has been restructured. The old `.metadata()` method may not work as before.","severity":"breaking","affected_versions":">=1.0.0rc1"},{"fix":"Use `ekd.from_source('url', url)` or `ekd.from_source(url=url)` (preferred).","message":"Using `from_source` with positional arguments for source type is deprecated; use keyword arguments or switch to the new URL-based API.","severity":"deprecated","affected_versions":"<1.0.0"},{"fix":"Install required backend: `pip install eccodes` (or `cfgrib`) for GRIB, `netcdf4` for NetCDF.","message":"The library expects specific backends for different formats; missing eccodes will cause GRIB loading to fail silently or raise confusing errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `ds.to_xarray(chunks={'time': 1})` to control chunking.","message":"`ds.to_xarray()` can be memory-intensive for large datasets; prefer lazy loading with `ds.to_xarray(chunks={})` or iterate in chunks.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install eccodes","cause":"Missing backend library for GRIB support.","error":"ModuleNotFoundError: No module named 'eccodes'"},{"fix":"First check the type of data: `print(type(ds[0]))` and use appropriate methods like `ds[0].keys()` for ODB.","cause":"Using a method not available in the current source type (e.g., ODB objects do not have a single metadata concept).","error":"AttributeError: 'Reader' object has no attribute 'metadata'"},{"fix":"Verify the URL or file path. For URLs, ensure network access and correct URL syntax.","cause":"URL not accessible or file does not exist.","error":"earthkit.data.core.DataError: Unable to open resource"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}