On Tue, Dec 29, 2009 at 10:34:17AM +0800, 龟腚 wrote:
> hi, i am a protobuf user also python user
> and i want to translate protobuf object to python Dict object (or call it
> hash?)
> its because i was developing a web gate witch query data from intranet's ice
> server and got the data in protobuf type
> then i translate it to Dict object and return it to internet user as in json
> format.
> any advice or suggestion is welcom
I've created JSON serialilzation/deserialization routines for PB messages in
my RPC project [1]. Usage is simple -- import file [2] and if one of JSON
implementations (simplejson or cjson) are available You'll be able to call
SerializeToJSON and ParseFromJSON methods.
Pavel
--
[1] http://grid.pp.ru/wiki/pbufrpc#_json_wire_format
[2] http://grid.pp.ru/cgit/psha/pbufrpc/tree/pbufrpc/json.py