Source code for oasislmf.execution.complex_items_to_bin
#!/usr/bin/env python"""Implementation of ktool items conversion tool including complex item data serialized with msgpack."""importstructimportsysimportmsgpackimportpandasaspd
[docs]defmain()->None:PY3K=sys.version_info>=(3,0)ifPY3K:output=sys.stdout.bufferelse:# Python 2 on Windows opens sys.stdin in text mode, and# binary data that read from it becomes corrupted on \r\nifsys.platform=="win32":# set sys.stdin to binary modeimportosimportmsvcrtmsvcrt.setmode(sys.stdout.fileno(),os.O_BINARY)output=sys.stdoutitems_to_bin(sys.stdin,output)