title: Converting protobuf feed to pandas dataframe
body: <p>I'm trying to covert a protobuf feed to pandas dataframe for one of my hobby projects. I tried several different techniques to accomplish this but nothing seems to really solve my issue.</p>
  <p>I use following code to retrieve GTFS-RT TripUpdates feed:</p>
  <pre><code>feed = gtfs_realtime_pb2.FeedMessage()
  headers = {
      'Accept': 'application/octet-stream',
      'Accept-encoding': 'br, gzip, deflate'
  }
  
  response = requests.get('&lt;PROVIDER:APIKEY&gt;', headers=headers, stream=True)
  
  feed.ParseFromString(response.content)
  test_dict = protobuf_to_dict(feed)
  </code></pre>
  <p>The result of using <code>protobuf_to_dict</code> is a a dict with one single line:</p>
  <pre><code>{'header': {'gtfs_realtime_version': '2.0', 'incrementality': 0, 'timestamp': 1641582104}, 'entity': [{'id': '14050001276385923' [...]
  </code></pre>
  <p>I've tried several things get around this issue.</p>
  <p><strong>Reading feed message as JSON</strong>: did not work because the JSON object must be str, bytes or bytearray, not dict.</p>
  <p><strong>Iterating through dict</strong>:</p>
  <pre><code>for entity in test_dict.entity:
      if entity.HasField('vehicle')
          [logic for building dataframe]
  </code></pre>
  <p>It didn't work either, because 'dict' object has no attribute 'entity'.</p>
  <p>Ok! After several hours of reading I tried to flatten and normalize feed message as described <a href="https://stackoverflow.com/questions/65816113/how-to-convert-gtfs-rt-trip-updates-data-to-a-dataframe">here</a> and some other threads. Unfortunately, neither <code>json_normalize</code> or <code>flatten_json</code> did solve the issue.</p>
  <p>At this point I feel like going in circle and not seeing something very obvious that might help me. The end-goal is to create a dataframe which contains TripUpdates data which later will be merged with another dataframe to update arrival and departure times.</p>