I’d recommend using protobuf↔json converters from google’s protobuf library:
from google.protobuf.json_format import MessageToJson
json_obj = MessageToJson(org)
You can also serialise the protobuf to a dictionary:
from google.protobuf.json_format import MessageToDict
dict_obj = MessageToDict(org)
Refer to the protobuf package API documentation: https://developers.google.com/protocol-buffers/docs/reference/python/ (see module google.protobuf.json_format
).