title: "Extended" template-based INI file parsing in Python
body: <p>I need to parse (and feed to a database) configuration files like this one (actually it is <code>Asterisk</code>'s <code>sip.conf</code>):</p>
  
  <pre><code>[client-template](!,natted-template)
  foo=foovalue
  moo=moovalue
  
  [client](client-template)
  bar=barvalue
  </code></pre>
  
  <p>This syntax means that <code>client-template</code> is a template itself (because of <code>!</code> in parentheses) based on <code>natted-template</code> (defined elsewhere). And <code>client</code> is an object definition, based on <code>client-template</code>.</p>
  
  <p>I could use <code>ConfigParser</code>, but it looks like I need something more powerful or customized?</p>