title: Python3: Converting a nested dict into a list of objects with "children" and "leaf"?
body: <p>I'm currently trying to convert a nested dict into a list of objects with "children" and "leaf".
  Here my input dict and the output I'm trying to obtain:</p>
  
  <p>Input:</p>
  
  <pre><code>{
      "a": {
          "aa": {}
      },
      "b": {
          "c": {
              "d": {
                  'label': 'yoshi'
              }
          },
          "e": {},
          "f": {}
      }
  }
  </code></pre>
  
  <p>I try to obtain this:</p>
  
  <pre><code>[
      {
          "text": "a",
          "children": [
              {
                  "text": "aa",
                  "leaf": "true"
              }
          ]
      },
      {
          "text": "b",
          "children": [
              {
                  "text": "c",
                  "children": [
                      {
                          "text": "d",
                          "leaf": "true",
                          "label": "yoshi"
                      }
                  ]
              },
              {
                  "text": "e",
                  "leaf": "true"
              },
              {
                  "text": "f",
                  "leaf": "true"
              }
          ]
      }
  ]
  </code></pre>
  
  <p>I've tried a few unflatten python lib on pypi but not one seems to be able to output a list format like this.</p>