Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 583 Bytes

README.md

File metadata and controls

24 lines (18 loc) · 583 Bytes

py-pb-converters

py-pb-converters is a set of python convinience scripts for conversion between Google's Protocol Buffers and JSoN.


Example of usage:


from addressbook_pb2 import AddressBook
import extend_pb2
import pbjson

# Convert python dict to Protobuf
adr_book = pbjson.dict2pb(AddressBook, adr_book_json, extend=extend_pb2)

# Convert Protobuf to JSoN
new_json = pbjson.pb2json(adr_book)