Herbie: Download Weather Forecast Model Data in Python#

Access HRRR, GFS, RAP, GEFS, ECMWF and 15+ Weather Models

Herbie is a Python package that makes downloading and working with numerical weather prediction (NWP) model data simple and fast. Whether you’re a researcher, meteorologist, data scientist, or weather enthusiast, Herbie provides easy access to forecast data from NOAA, ECMWF, and other sources.

from herbie import Herbie

# Download HRRR 2-meter temperature
H = Herbie('2021-01-01 12:00', model='hrrr')
ds = H.xarray("TMP:2 m")
πŸ“˜ User Guide

Learn how to use Herbie with tutorials and examples

User Guide
πŸ–ΌοΈ Model Gallery

Browse examples for each supported weather model

Gallery
πŸ”§ API Reference

Complete reference for all classes and functions

API Reference
πŸ’¬ Community Support

Ask questions and share ideas on GitHub Discussions

https://github.com/blaylockbk/Herbie/discussions

Key Features:

  • 🌐 Access 15+ weather models including HRRR, GFS, RAP, GEFS, ECMWF, and more

  • ⚑ Smart downloads - Get full GRIB2 files or subset by variable to save time and bandwidth

  • πŸ“Š Built-in data reading - Load data directly into xarray for analysis

  • πŸ—ΊοΈ Visualization aids - Includes Cartopy integration for mapping

  • πŸ”„ Multiple data sources - Automatically search multiple archive sources (AWS, Google Cloud, NOMADS, Azure)

  • πŸ› οΈ CLI and Python API - Use from command line or in your Python scripts


Supported Weather Models#

Herbie provides access to many numerical weather prediction models, including:

US Models (NOAA):

  • High-Resolution Rapid Refresh (HRRR) - 3km resolution short-range forecasts

  • Rapid Refresh (RAP) - 13km resolution regional forecasts

  • Global Forecast System (GFS) - Global medium-range forecasts

  • Global Ensemble Forecast System (GEFS) - Global ensemble predictions

  • AI Global Forecast System (AIGFS) - AI Global medium-range forecasts

  • AI Global Ensemble Forecast System (AIGEFS) - AI Global ensemble predictions

  • Hybrid Global Ensemble Forecast System (HGEFS) - Hybrid Global ensemble predictions

  • National Blend of Models (NBM) - Statistically blended forecasts

  • Rapid Refresh Forecast System (RRFS) - Next-generation RAP/HRRR (prototype)

  • Real-Time/Un-Restricted Mesoscale Analysis (RTMA/URMA) - Gridded observations

  • Hurricane Analysis and Forecast System (HAFS) - Tropical cyclone forecasts

  • Climate Forecast System (CFS) - Seasonal predictions

Other Models:

  • ECMWF Open Data - IFS and AIFS global forecast models

  • NAVGEM - US Navy global environmental model

  • HRDPS - Canadian high-resolution forecasts

See the Gallery for complete model coverage.

Tip

Much of this data is made available through the NOAA Open Data Dissemination (NODD) program, making weather data more accessible than ever before.

Installation#

mamba install -c conda-forge herbie-data
conda install -c conda-forge herbie-data
pip install herbie-data

Add Herbie to your uv project with the following command:

uv add herbie-data

Or install Herbie as a tool for its CLI

uv install herbie-data

Requirements:

  • Python 3.11 or higher

  • xarray and cfgrib for reading GRIB2 data

  • wgrib2 (optional, for advanced subsetting)

For detailed installation instructions, see 🐍 Installation.

What Can Herbie Do?#

Herbie streamlines the entire workflow of accessing weather model data:

_images/mermaid-capabilities.png

Features:

  • πŸ” Search model output from different data sources

  • ⬇️ Download full or subset GRIB2 files

  • πŸ“– Read data with xarray and index files with Panda (see πŸ—ƒοΈ Xarray Accessors)

  • πŸ—ΊοΈ Built-in Cartopy aids for mapping

  • 🎯 Extract data at specific points

  • πŸ”Œ Extensible with [custom model templates](blaylockbk/herbie-plugin-tutorial)


Using Herbie#

Herbie Python API#

The Python API provides full programmatic access to all features:

from herbie import Herbie

# Create Herbie object for the HRRR model 6-hr surface forecast product
H = Herbie(
  '2021-01-01 12:00',
  model='hrrr',
  product='sfc',
  fxx=6
)

# Look at the GRIB2 file contents
H.inventory()

# Download the full GRIB2 file
H.download()

# Download a subset of the file, like all fields at 500 mb
H.download(":500 mb")

# Read a subset of the file with xarray, like 2-m temperature.
H.xarray("TMP:2 m")

Learn more: User Guide

Herbie Command Line Interface#

Use Herbie directly from your terminal:

# Get the URL for a HRRR surface file from today at 12Z
herbie data -m hrrr --product sfc -d "2023-03-15 12:00" -f 0

# Download GFS 0.25Β° forecast hour 24 temperature at 850mb
herbie download -m gfs --product 0p25 -d 2023-03-15T00:00 -f 24 --subset ":TMP:850 mb:"

# View all available variables in a RAP model run
herbie inventory -m rap -d 2023031512 -f 0

# Download multiple forecast hours for a date range
herbie download -m hrrr -d 2023-03-15T00:00 2023-03-15T06:00 -f 1 3 6 --subset ":UGRD:10 m:"

# Specify custom source priority (check only Google)
herbie data -m hrrr -d 2023-03-15 -f 0 -p google

More details in the User Guide.


Note

Project maintained by Brian Blaylock

Check out Brian’s other Python packages for atmospheric science: