title: python example for reading multiple protobuf messages from a stream
body: <p>I'm working with data from spinn3r, which consists of multiple different protobuf messages serialized into a byte stream:</p>
  
  <p><a href="http://code.google.com/p/spinn3r-client/wiki/Protostream">http://code.google.com/p/spinn3r-client/wiki/Protostream</a></p>
  
  <p>"A protostream is a stream of protocol buffer messages, encoded on the wire as length prefixed varints according to the Google protocol buffer specification. The stream has three parts: a header, the payload, and a tail marker."</p>
  
  <p>This seems like a pretty standard use case for protobufs.  In fact, protobuf core distribution provides CodedInputStream for both C++ and Java.  But, it appears that protobuf does not provide such a tool for python -- the 'internal' tools are not setup for this kind of external use:</p>
  
  <p><a href="https://groups.google.com/forum/?fromgroups#!topic/protobuf/xgmUqXVsK-o">https://groups.google.com/forum/?fromgroups#!topic/protobuf/xgmUqXVsK-o</a></p>
  
  <p>So... before I go and cobble together a python varint parser and tools for parsing a stream of different message types:  does anyone know of any tools for this? </p>
  
  <p>Why is it missing from protobuf?  (Or am I just failing to find it?)</p>
  
  <p>This seems like a big gap for protobuf, especially when compared to thrift's equivalent tools for both 'transport' and 'protocol'.  Am I viewing that correctly?</p>