python google protobuf and optional field with empty repeated inside (or the 'has_field = true' analog in python)

So I was searching for something to represent protobufs in a human-readable format. After lots of googling I’ve found that there is a magic built-in module called text_format, which does just what I need - it converts protobufs to/from human readable format, which looks quite similar to JSON. But it is not actually a valid JSON, as JSON-supported types don’t match protobufs, and it has a slightly different format. Pb text is fine for reading, but it has a very limited amount of tools that actually support it....

January 14, 2015 · 2 min · 404 words · Ruslan Kuprieiev