title: Reading a configuration file in Python (storing/reading nested data with ConfigParser)
body: <p>I am writing a list processing script that needs to read configuration data about each item in the list. The configuration data is best represented as a nested tree.</p>
  
  <p>I would normally have used YAML for storing the data - but I think that using ConfigParser would be a more Pythonic approach - and make the script more 'transparent' to other Python coders - since a surprising number of people are not familiar with the YAML format.</p>
  
  <p>I have had a very quick look at the <a href="http://docs.python.org/library/configparser.html" rel="noreferrer">configParser documentation</a>, but I have not been able to ascertain whether it can deal with nested data.</p>
  
  <p>My configuration data will have the following structure:</p>
  
  <pre><code>&lt;markers&gt;
      &lt;marker&gt;
          &lt;date&gt;&lt;/date&gt;
          &lt;value&gt;&lt;/value&gt;
      &lt;/marker&gt;
  &lt;/markers&gt;
  &lt;items&gt;
      &lt;item&gt;
          &lt;start&gt;&lt;/start&gt;
          &lt;end&gt;&lt;/end&gt;
          &lt;mcc&gt;
             &lt;chg&gt;
                  &lt;date&gt;&lt;/date&gt;
                  &lt;ival&gt;&lt;/ival&gt;
                  &lt;fval&gt;&lt;/fval&gt;
             &lt;/chg&gt;
          &lt;/mcc&gt;
      &lt;/item&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>Can I use ConfigParser to read/(write ?) this kind of nested data in a config file? (I'm more interested in being able to read than writing the config file. I don't mind manually writing the config file if necessary).</p>