title: Unpacking deeply nested struct with given C header into dictionary?
body: <p>I'm looking for a way to unpack binary data. The data is described by a whole tree of structs (up to four layers deep, total struct size is almost 64k) in a C header file.</p>
  
  <p>For this question: <a href="https://stackoverflow.com/questions/18082211/unpacking-nested-c-structs-in-python">Unpacking nested C structs in Python</a> the only answer was to "flatten" the whole data description into one string, but I'm reluctant to do this in my case because it would be unmaintainable.</p>
  
  <p>What I'd love to have is something that reads the header file and then magically creates a function that takes the binary data and returns a (properly nested) dictionary with all the data.</p>
  
  <p>Is there any Python module that can accomplish this, or some parts of it?</p>
  
  <p>Or are there other ways to deal with such data in Python?</p>