title: JSON parsing of Dropbox Metadata in python
body: <p>Using Dropbox APIs, I am able to get view of all the folders in the root folder and using metadata, I can print all the information from JSON on the screen. </p>
  
  <p>For example, a sample output would be like</p>
  
  <pre><code>{
      'bytes': 0,
      'contents': [
          {
             'bytes': 0,
             'icon': 'folder',
             'is_dir': True,
             'modified': 'Thu, 25 Aug 2011 00:03:15 +0000',
             'path': '/Sample Folder',
             'rev': '803beb471',
             'revision': 8,
             'root': 'dropbox',
             'size': '0 bytes',
             'thumb_exists': False
          }, 
          {
             'bytes': 77,
             'icon': 'page_white_text',
             'is_dir': False,
             'mime_type': 'text/plain',
             'modified': 'Wed, 20 Jul 2011 22:04:50 +0000',
             'path': '/magnum-opus.txt',
             'rev': '362e2029684fe',
             'revision': 221922,
             'root': 'dropbox',
             'size': '77 bytes',
             'thumb_exists': False
          }
      ],
      'hash': 'efdac89c4da886a9cece1927e6c22977',
      'icon': 'folder',
      'is_dir': True,
      'path': '/',
      'root': 'app_folder',
      'size': '0 bytes',
      'thumb_exists': False
  }
  </code></pre>
  
  <p>I am not sure, how can I get elements of 'contents' array and then recursively, get files using 'path' attribute. </p>
  
  <p>And my ultimate goal is to get list of all files in <code>Dropbox</code> folder. Is there any better way to get list of all files?</p>
  
  <p>I have tried following code:</p>
  
  <pre><code>folder_metadata = self.api_client.metadata('/Photos')
  print "-----------------------------"
  print "path:", folder_metadata['path']
  for s in folder_metadata['contents']:
      for dirname, dirnames, filenames in os.walk(s['path']):
          for filename in filenames:
              var = os.path.join(dirname, filename)
              print var
  </code></pre>
  
  <p>and its output is:</p>
  
  <pre><code>-----------------------------
  path: /Photos
  </code></pre>
  
  <p>How can I get an absolute path?</p>