title: Alternative to copy file content in a dictionary in YAML
body: <p>I have a text file similar like this</p>
  
  <pre class="lang-none prettyprint-override"><code>[Kingdom]
  Animal=rabbit
  Species=mammal
  
  [Rabbit]
  Name=Alex
  </code></pre>
  
  <p>So, I just copy the file into a dictionary using <code>MasterDict = config.__dict__['_sections'].copy()</code></p>
  
  <p>How can I use the same function with YAML file. I converted the same text file into YAML like this,</p>
  
  <pre class="lang-none prettyprint-override"><code>default:
    Animal : rabbit
    Species : Mammal
  
  rabbit:
    Name:Alex
  </code></pre>