There In addition to the low-level C-like interface, there are now Python classes that can be used to represent the objects one often works of interest whilst processing GRIB and BUFR messages.
...
GribFiles and BufrFiles can be treated mostly as regular files and used as context managers, as can GribMessages/BufrMessages. Each of these classes destructs itself and any child instances appropriately.
Details