pdbufr

raw JSON →
0.14.2 verified Fri May 01 auth: no python

pdbufr is a Python library for reading BUFR (Binary Universal Form for the Representation of meteorological data) files into pandas DataFrames. Built on ecCodes, it simplifies decoding of complex BUFR messages. Current version: 0.14.2, with monthly/quarterly releases.

pip install pdbufr
error ModuleNotFoundError: No module named 'eccodes'
cause ecCodes C library not installed or not found.
fix
Install eccodes via conda ('conda install -c conda-forge eccodes') or system package manager (apt-get install libeccodes-dev).
error KeyError: 'latitude'
cause BUFR file does not contain the requested column name.
fix
Use read_bufr(file, flatten=False) to see all available parameter names.
error pdbufr.errors.EcCodesError: Error while loading BUFR file
cause File is corrupt or not a valid BUFR format.
fix
Verify file integrity and ensure it is a BUFR file (not GRIB or other).
deprecated The pdbufr.from_source function is deprecated since v0.14.0; use read_bufr directly.
fix Replace pdbufr.from_source(...) with pdbufr.read_bufr(...).
breaking ECCODES_PATH environment variable is no longer supported. ecCodes must be in PATH or standard install location.
fix Install eccodes via system package manager or conda, or set LD_LIBRARY_PATH.
gotcha Column names must match BUFR parameter names exactly; case-sensitive. Use `columns` parameter to avoid reading all columns.
fix Check BUFR parameter names via `read_bufr(file, flatten=False).columns`.
deprecated The `flatten` parameter default changed to True in v0.13.0; setting to False returns nested dicts.
fix Specify flatten=False explicitly if you need nested structure.

Reads selected columns from a BUFR file into a pandas DataFrame.

from pdbufr import read_bufr

df = read_bufr('path/to/file.bufr', columns=['latitude', 'longitude', 'airTemperature'])
print(df.head())