grib-rust
Pure-Rust, read-only GRIB decoder for weather and climate data. No C libraries, no build scripts, and no unsafe beyond memmap2.
Crates
| Crate | Description |
|---|---|
grib-reader |
GRIB1/GRIB2 field scanning, metadata parsing, and packed data decoding |
Usage
use GribFile;
let file = open?;
println!;
for msg in file.messages
let data = file.message?.read_data_as_f64?;
println!;
let tolerant = from_bytes_with_options?;
println!;
Supported Now
- GRIB1 and GRIB2 message scanning with
"GRIB"/"7777"boundary detection - Logical field indexing for multi-field GRIB2 messages
- Regular latitude/longitude grids for GRIB1 and GRIB2
- Simple packing for GRIB1 and GRIB2
- WMO parameter table lookups (Code Table 4.2)
- Typed metadata access for reference time, parameter identity, product metadata, grid geometry, and lat/lon coordinates
OpenOptionsfor strict or tolerant scanning- Bitmap application with missing values surfaced as
NaN - Parallel field decoding via Rayon
- Output:
ndarray::ArrayD<f64> - Memory-mapped I/O or owned byte buffers
Not Yet Supported
- Non-lat/lon grid templates
- Complex packing and more advanced multi-packing templates
- JPEG2000 and PNG-packed GRIB2 fields
- GRIB1 predefined bitmaps
Unsupported cases fail explicitly with typed errors.
Feature flags
| Flag | Default | Description |
|---|---|---|
rayon |
yes | Parallel field decoding |
Testing
Release Checklist
Corpus And Fuzzing
- Bootstrap corpus samples live in
grib-reader/tests/corpus/bootstrap/ - Real interoperability samples belong in
grib-reader/tests/corpus/interop/samples/ - Regenerate the bootstrap and fuzz seed corpora with
cargo run -p grib-reader --example sync_corpus - Fuzzer entry points and usage notes live in
grib-reader/fuzz/README.md
License
MIT OR Apache-2.0