title: Calculate Each dropbox folder size recursively using python api
body: <p><strong>EDIT:</strong> I want to calculate each folder size not just entire dropbox size... My code is working fine for whole dropbox size</p>
  
  <p>I am having difficulty in calculating each folder size of dropbox using python api
  as dropbox returns folder size as zero</p>
  
  <p>here's my code so far but it's giving me wrong answer</p>
  
  <pre><code>  def main(dp_path):
     a=  client.metadata(dp_path)
     size_local = 0
     for x in a['contents']:
       if x['is_dir']==False:
         global size
         size += int(x['bytes'])
         size_local += int(x['bytes'])
  
         #print "Total size so far :"+str(size/(1024.00*1024.00))+" Mb..." 
  
  
       if x['is_dir']==True:
         a = main(str(x['path']))
         print str(x['path'])+" size=="+str(a/(1024.00*1024.00))+" Mb..."
  
       return size_local+size
  
  
   if __name__ == '__main__':
     global size
     size=0
     main('/')
     print str(size/(1024.00*1024.00))+" Mb" 
  </code></pre>