Skip to content

Instantly share code, notes, and snippets.

@pat1
Created March 18, 2020 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pat1/e80377dbd7b934f66bbfcc68cf3f048f to your computer and use it in GitHub Desktop.
Save pat1/e80377dbd7b934f66bbfcc68cf3f048f to your computer and use it in GitHub Desktop.
import dballe
import sys
importer = dballe.Importer("JSON")
exporter = dballe.Exporter("BUFR")
inputfile = sys.stdin
with importer.from_file(inputfile) as fp:
for msgs in fp:
for msg in msgs:
sys.stdout.buffer.write(exporter.to_binary(msg))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment