I am dealing with the protobuf protocol and I encounter the need of decoding messages of unknown fields and types. I know protoc --decode_raw
does a good job at that (alas not precise but good enough).
I was thinking about running protoc --decode-raw
in a shell and let Python read its content, parsing it as a dictionary, but I figure it is the last resort of implementation.
Is there a Pythonic method of implementing the same functionality?