title: Gen Fill Rates on Varying Nested Dictionaries in Python?
body: <p>I have a process that receives nested dictionaries in Python:</p>
  
  <p>Example Nested Dictionary Schema (pseudocode)</p>
  
  <pre><code>key1: value1,
  key2: dict(
    key3: value2,
    key4: value3,
  ),
  key5: list(value4,value5) # any value is fine, just not empty or null
  </code></pre>
  
  <p>Example Nested Dictionary Data (pseudocode)</p>
  
  <pre><code>key1: 'value',
  key2: dict(
    key3: '',
    key4: 12345,
  ),
  key5: list()
  </code></pre>
  
  <p>I want to iterate over/scan this dict and check if each key has a value (is not Null or blank - false/0 are ok). I will need to scan a bunch of identical dicts to get an overall "fill rate" for that set of dicts. The process sees sets of dicts with different formats every time it's run, so it needs to automatically generate the fill rate report:</p>
  
  <p>Example Fill Rate for the Single Nested Example Above (ideally a flat dict):</p>
  
  <pre><code>key1: 1
  key2: 1
  key2-key3: 0
  key2-key4: 1
  key5: 0
  </code></pre>
  
  <p>If we scanned ten dicts of the same structure, for example, we might see a :fill rate" like this:</p>
  
  <pre><code>key1: 5
  key2: 6
  key2-key3: 6
  key2-key4: 4
  key5: 3
  </code></pre>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li><p>What is the most pythonic way to scan dicts of varying structure to gen a fill rate? Is there a more efficient way if I have to do this millions of times?</p></li>
  <li><p>What is the most pythonic way to create a flat dict to store the counts and how do I update it?</p></li>
  </ol>