Skip to main content

GRIB2 Format

Read GRIB2 meteorological messages as dictionaries (one message per record).

Overview

PropertyValue
Format idgrib2 (alias grib)
ClassGRIB2Iterable
Extensions.grib2, .grb2, .grib
ReadYes
WriteNo
Extrageophysical
Maturityexperimental

Record shape

Backend-dependent. Records always include shortName and values. With cfgrib, coordinates such as time, step, level, latitude, and longitude may also appear.

Backend preference: cfgrib (+ xarray) → pygrib → eccodes. All messages are loaded into memory; a filename path is required.

Usage

from iterable import open_iterable

with open_iterable("forecast.grib2", format="grib2") as source:
for msg in source:
print(msg["shortName"], len(msg["values"]))

Install with pip install iterabledata[geophysical].

See also