The proto_message_utils.py module#

Summary#

protobuf_message_to_str

Convert a protobuf message to formatted json string.

protobuf_message_to_dict

Convert protobuf message to a formatted json dict.

Description#

Module with utility elements for protobuf messages from Speos RPC server.

Module detail#

proto_message_utils.protobuf_message_to_str(message, with_full_name=True)#

Convert a protobuf message to formatted json string.

Parameters:
messagegoogle.protobuf.message.Message

Protobuf message.

with_full_namebool

Prepend the returned string with protobuf message full name. By default, True.

Returns:
str

protobuf message formatted to be logged/printed.

proto_message_utils.protobuf_message_to_dict(message)#

Convert protobuf message to a formatted json dict.

Parameters:
messagegoogle.protobuf.message.Message

Protobuf message.

Returns:
dict

protobuf message formatted as dict.