Registry / data / earthkit-data

earthkit-data

JSON →
library0.20.0pypypi✓ verified 85d ago

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.

pip install earthkit-data
INSTALL
IMPORT
SIG · EARTHKIT-DATA
E
earthkit-data
datapythonv0.20.0
Install
16.0s avg
Import
542ms
Disk
371MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.20.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 16.0s · import 0.542s · 319MB
371MB installed
● package 371MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

earthkit.data
import earthkit.data as ekd
from earthkit import data
Most examples use 'import earthkit.data as ekd'; 'from earthkit import data' also works but can cause confusion.
realize
from earthkit.data import from_source
from earthkit.data.core import Base
Low-level core classes are not part of the public API; use from_source instead.

Load a GRIB file from a URL and convert to xarray.

import earthkit.data as ekd # Load GRIB data from a URL ds = ekd.from_source("url", "https://get.ecmwf.int/repository/test-data/earthkit-data/example.grib") # Inspect metadata print(ds[0].metadata("param")) # Convert to xarray xr_ds = ds.to_xarray() print(xr_ds)
Debug
Known issues
breakingVersion 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.
fix
Refer to the upgrade guide at https://earthkit-data.readthedocs.io/en/latest/release-notes/version_1.0.0rc_updates.html
affects: >=1.0.0rc1
deprecatedUsing `from_source` with positional arguments for source type is deprecated; use keyword arguments or switch to the new URL-based API.
fix
Use `ekd.from_source('url', url)` or `ekd.from_source(url=url)` (preferred).
affects: <1.0.0
gotchaThe library expects specific backends for different formats; missing eccodes will cause GRIB loading to fail silently or raise confusing errors.
fix
Install required backend: `pip install eccodes` (or `cfgrib`) for GRIB, `netcdf4` for NetCDF.
affects: all
gotcha`ds.to_xarray()` can be memory-intensive for large datasets; prefer lazy loading with `ds.to_xarray(chunks={})` or iterate in chunks.
fix
Use `ds.to_xarray(chunks={'time': 1})` to control chunking.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'eccodes'
Missing backend library for GRIB support.
fix
pip install eccodes
AttributeError: 'Reader' object has no attribute 'metadata'
Using a method not available in the current source type (e.g., ODB objects do not have a single metadata concept).
fix
First check the type of data: `print(type(ds[0]))` and use appropriate methods like `ds[0].keys()` for ODB.
earthkit.data.core.DataError: Unable to open resource
URL not accessible or file does not exist.
fix
Verify the URL or file path. For URLs, ensure network access and correct URL syntax.
Upgrade
Version history
0.20.0latest on PyPI · released May 13, 2026
Audit
Dependencies
eccodesoptionalRequired for GRIB support
cfgriboptionalAlternative GRIB engine
netcdf4optionalRequired for NetCDF support
Agent activity
13 hits · last 30 days
node
12
Resources
earthkit-data — pip install earthkit-data · libregistry