python协议缓冲区编译器
pyprotobuf的Python项目详细描述
##########
pyprotobuf
##########
protocol buffers compiler
Visit http://code.google.com/p/pyprotobuf for more information.
Installation
############
From PyPi::
pip install pyprotobuf
Usage
#####
.. 程序::pyprotoc
…选项:---格式
选择输出格式
…选项::-h,帮助-BR/> BR/>显示帮助消息:
> BR/>用法:PyPotoCoc [-H] [格式{闭包,Python,Extrus}〕路径[ BR/>< BR/>位置参数:
路径
BR/>可选参数:
-H,帮助显示此帮助消息并退出
格式{闭包,python,externs}
example
input file(test.proto)::
option javascript\u package=“com.example”;
message item{
optional string astring=1;
optional int32 anumber=2;
required string are required string=3;
repeated string=4;
}
从proto rpc导入消息生成python rpc(`protopy--format python test.proto`):
class item(messages.message):
astring=messages.stringfield(1)
anumber=messages.integerfield(2)
需要字符串=messages.stringfield(3,required=true)
arepeatedstring=messages.stringfield(4,repeated=true)
/**@type{string}*/
com.example.item.prototype.astring;
/**@type{number}*/
com.example.item.prototype.anumber;
/**@type{string}*/
com.example.item.prototype.arequiredstring;
/**@type{[string]}*/
com.example.item.prototype.arepeatedstring;
development
pyprotobuf
##########
protocol buffers compiler
Visit http://code.google.com/p/pyprotobuf for more information.
Installation
############
From PyPi::
pip install pyprotobuf
Usage
#####
.. 程序::pyprotoc
…选项:---格式
选择输出格式
…选项::-h,帮助-BR/> BR/>显示帮助消息:
> BR/>用法:PyPotoCoc [-H] [格式{闭包,Python,Extrus}〕路径[ BR/>< BR/>位置参数:
路径
BR/>可选参数:
-H,帮助显示此帮助消息并退出
格式{闭包,python,externs}
example
input file(test.proto)::
option javascript\u package=“com.example”;
message item{
optional string astring=1;
optional int32 anumber=2;
required string are required string=3;
repeated string=4;
}
从proto rpc导入消息生成python rpc(`protopy--format python test.proto`):
class item(messages.message):
astring=messages.stringfield(1)
anumber=messages.integerfield(2)
需要字符串=messages.stringfield(3,required=true)
arepeatedstring=messages.stringfield(4,repeated=true)
/**@type{string}*/
com.example.item.prototype.astring;
/**@type{number}*/
com.example.item.prototype.anumber;
/**@type{string}*/
com.example.item.prototype.arequiredstring;
/**@type{[string]}*/
com.example.item.prototype.arepeatedstring;
development