skillfed

pygrib

Python module for reading/writing GRIB files

pygrib v2.1.8 437.3K downloads/30d#6,670 on PyPI356
Permissive license MIT AND (Apache-2.0 OR BSD-2-Clause) Active released

What it is and what it does

pygrib is a Python wrapper around the ECMWF ECCODES library for reading and writing GRIB meteorological data files. GRIB is the standard format for storing weather and climate model output, satellite observations, and other gridded atmospheric data. The package provides a high-level interface to parse GRIB files and access their contents as Python objects, making it straightforward to integrate meteorological data into scientific workflows.

The package supports reading GRIB files fully and has limited write capabilities—you can modify the contents of an existing GRIB file but cannot create one from scratch. It depends on numpy, pyproj, and packaging, and requires the ECCODES C library to be present on your system. Wheels are available for Python 3.10–3.14 on macOS and Linux, though you will need to ensure ECCODES is installed separately or available via your package manager.

Use it for:

  • Load weather model output (e.g., from NOAA or ECMWF) for analysis or visualization in scientific Python workflows.
  • Extract specific meteorological variables (temperature, pressure, wind) from GRIB files for data processing.
  • Modify metadata or values in existing GRIB files for reprocessing or redistribution.
  • Integrate gridded climate or weather data into machine learning or statistical analysis pipelines.
  • Convert GRIB data to other formats (e.g., NetCDF) by reading and transforming with numpy and pyproj.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Reads and writes GRIB meteorological data files via a Python interface to the ECMWF ECCODES C library, with limited write support for modifying existing files.

Yes, if you work with meteorological or climate data in GRIB format and have access to the ECCODES library. The package is actively maintained, permissively licensed, and has no known vulnerabilities. Install friction is moderate due to the C dependency, but pre-built wheels and conda packages ease deployment on standard platforms. Not suitable if you need to create GRIB files from scratch or lack system-level ECCODES installation.

Install

pygrib on PyPI

pip

pip install pygrib

uv

uv add pygrib

poetry

poetry add pygrib

Installing pygrib

Before you install

Medium install friction due to a compiled C dependency (ECCODES library). The package provides pre-built wheels for Python 3.10–3.14 on macOS and Linux, reducing friction for common platforms. Maintenance is active with a recent release (292 days ago) and ongoing repository activity.

License in practice

Dual-licensed under MIT and (Apache-2.0 OR BSD-2-Clause), all permissive. No restrictions on commercial or proprietary use.

Quickstart

pip install pygrib

import pygrib
grbs = pygrib.open('file.grib')
for grb in grbs:
    print(grb)

Requires the ECCODES C library installed on your system; pip will search common locations ($CONDA_PREFIX, /usr, /usr/local, /opt/local) or use $ECCODES_DIR if set.

Verify before relying

  • Whether pre-built wheels include ECCODES or if system installation is always required
  • Performance characteristics when reading large GRIB files
  • Extent of write capabilities beyond modifying existing files

Package facts

License MIT AND (Apache-2.0 OR BSD-2-Clause) (permissive)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 3 — packaging, pyproj, numpy
Maintenance actively maintained — 292 days since the last release
Last repo commit
First released
Downloads 437,312/month — #6,670 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pygrib-2.1.8-cp310-cp310-macosx_15_0_arm64.whl; pygrib-2.1.8-cp310-cp310-macosx_15_0_x86_64.whl; pygrib-2.1.8-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; pygrib-2.1.8-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pygrib-2.1.8-cp311-cp311-macosx_15_0_arm64.whl; pygrib-2.1.8-cp311-cp311-macosx_15_0_x86_64.whl; pygrib-2.1.8-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; pygrib-2.1.8-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pygrib-2.1.8-cp312-cp312-macosx_15_0_arm64.whl; pygrib-2.1.8-cp312-cp312-macosx_15_0_x86_64.whl; pygrib-2.1.8-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; pygrib-2.1.8-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pygrib-2.1.8-cp313-cp313-macosx_15_0_arm64.whl; pygrib-2.1.8-cp313-cp313-macosx_15_0_x86_64.whl; pygrib-2.1.8-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; pygrib-2.1.8-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pygrib-2.1.8-cp314-cp314-macosx_15_0_arm64.whl; pygrib-2.1.8-cp314-cp314-macosx_15_0_x86_64.whl; pygrib-2.1.8-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; pygrib-2.1.8-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Development Status :: 4 - BetaIntended Audience :: Science/ResearchProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python Modules

Tags

grib file reader pythonmeteorological data gribeccodes python wrapperweather data grib formatgrib file parsingclimate data grib filesatmospheric grib reader
meteorologygrib-formatgeospatial

More Python Modules packages