title: Getting nested dictionary from JSON using recursive function in python
body: <p>This is my JSON data. JSON data consists of some properties but I only need command and subcommands properties.</p>
  <pre><code>{
    command: 'abc',
    depth: 1,
    help: '...',
    subcommands:[
      {
        command: 'abc folder',
        depth: 2,
        help: '...',
        subcommands:[
          {
            command: 'abc folder add',
            depth: 3,
            help: '...',
            subcommands:[
              {
                command: 'abc folder add id',
                depth: 4,
                help: '...',
                subcommands: []
              },
              {
                command: 'abc folder add type',
                depth: 4,
                help: '...',
                subcommands: []
              },
              {
                command: 'abc folder add name',
                depth: 4,
                help: '...',
                subcommands: []
              }]
          }],
          {
            command: 'abc folder list',
            depth: 3,
            help: '...',
            subcommands: []
          },
          {
            command: 'abc folder view',
            depth: 3,
            help: '...',
            subcommands: [
              {
                command: 'abc folder view id',
                depth: 4,
                help: '...',
                subcommands: []
              },
              {
                command: 'abc folder view type',
                depth: 4,
                help: '...',
                subcommands: []
              },
              {
                command: 'abc folder view name',
                depth: 4,
                help: '...',
                subcommands: []
              }
          }]
      }]
  }
  </code></pre>
  <p>Nested dictionary I'd like to retrieve from the JSON data is following:</p>
  <pre><code>{
    'abc':
      {
        'folder':
          {
            'add':
              {
                'id': {},
                'type': {},
                'name': {}
              },
            'list': {},
            'view':
              {
                'id': {},
                'type': {},
                'name': {}
              }
          }
      }
  }
  </code></pre>
  <p>I need to use recursive function so that it will work for deeper properties.
  It only needs to use command and subcommands.
  If there's subcommands has empty value then in result, related property's value should also be empty.
  Please post your suggestion that effectively makes a nested python dictionary.</p>
  <p>All your answers will be appreciated.
  Thanks.</p>