I couldn\'t find anywhere a possibility to print a human friendly content of a Google Protobuf message.
Is there an equivalent in Python for Java\'s toString()
As answered, print
and __str__
do work, but I wouldn't use them for anything more than debug strings.
If you're writing to something that users could see, it's better to use the google.protobuf.text_format module, which has some more controls (e.g. escaping UTF8 strings or not), as well as functions for parsing text-format as protobufs.