NIST-ITL Python解析库
nistitl的Python项目详细描述
用于解析和生成NIST-ITL的纯python库 二进制文件。
安装
nistitl发布在pypi上,可以从那里安装:
pip install -U nistitl
快速启动
生成NIST-ITL二进制消息:
msg=nistitl.Message()msg.TOT='MY_TOT'r2=nistitl.AsciiRecord(2)r2+=nistitl.Field(2,3,alias='TEST')msg+=r2buffer=msg.NIST
解析NIST-ITL二进制消息:
msg=nistitl.Message()msg.parse(buffer)print("The TOT is ",msg.TOT)forrecordinmsg.iter(2):print("Field 2.003 is ",record._3)
有关详细信息,请参见the full documentation。