I am currently interacting with a server that provides protocol buffers. I can get a very large number of messages. My current process is to read protocol buffers and convert them to a Pandas DataFrame (not a necessary step in general, but Pandas offers good tools for analyzing data sets):
- Read the protocol buffer, this will be the goob protobuf object
- Convert protocol buffers to a dictionary using protobuf_to_dict
- use
pandas.DataFrame.from_records to get a DataFrame
This works fine, but given the large number of posts I read from protobuf, itβs pretty hard to convert to a dictionary and then to pandas. My question is: is it possible to create a class that can make a protobuf python object look like a dictionary? That is, delete step 2. Any links or pseudo-code will be useful.
source share