一个库,用于添加一些使用protobuf的可用性工具
protobuf-tools的Python项目详细描述
目的
- 方便编辑和读取协议缓冲区文件
- 它提供了对原始文件进行编码/解码的简单界面
安装
此软件包可以通过PIP安装
pip install protobuf_tools
注意
使用Python2.7和Proto 2构建和测试
用法
Python
您可以将其作为
from protobuf_tools import proto_utils
原型工具
要用于读取/解码任何proto文件,请使用脚本实用程序protobuftools 如果不提供–proto路径,则默认为工作目录
#####如需帮助,请使用
protobuftools -h
#####要使用json进行解码或编码,请使用-json标志
#####使所有字段都成为解码使用的一部分–所有字段
#####用于将protobuf文件解码为更可读的形式
protobuftools “<path_to_proto_stream_file>” –proto_path “<optional - provide path to where _pb2 files are>” –decode=message_name –allfields -json
####显示而不是写入文件
protobuftools “<path_to_proto_stream_file>” –proto_path “<optional - provide path to where _pb2 files are>” –decode=message_name –allfields -json -d
#####对于编码-要从json/text转换为protobuf文件,输出是一个扩展名为.protoout的文件
protobuftools “<path_to_file(.json/.txt etc) from above” –proto_path “<optional - provide path to where _pb2 files are>” –encode=message_name -json
对于错误
加入protobuf_tools频道
您也可以发电子邮件给我
pip[at]abhijit.bansal.com
未来
- 添加用于查看和编辑的用户界面工具
- 支持Python3和Proto3
版本历史记录
0.0.3:将protobuf版本更改为3.2.0也适用于任何其他版本
0.0.2:更改了protobuf的设置版本
0.0.1:初始版本,测试上传到PYPI