title: Creating a namespace with a dict of dicts
body: <p>Currently I am using <code>json</code> to save a dict to a config file. I load this to turn it into a <code>dict</code> then turn it into a <code>SimpleNamespace</code> because I prefer dot notation to access the settings. To do this, I load it as in this example:</p>
  
  <pre><code>import json
  from types import SimpleNamespace
  SETTINGS = json.load(open("config.json", 'r'))
  SETTINGS = SimpleNamespace(**SETTINGS)
  </code></pre>
  
  <p>However, as I am currently loading the <code>dict</code> into a <code>SimpleNamespace</code> it is not loading the sub dicts within the config file. So for example if I do:</p>
  
  <pre><code>SETTINGS.server_info.port
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>AttributeError: 'dict' object has no attribute 'port'
  </code></pre>
  
  <p>I was wondering how I load all dicts into the namespace as name spaces so that I am able to use dot notation all the way down the dictionary.</p>