Skip to content

Instantly share code, notes, and snippets.

@kevinschoon
Created September 13, 2015 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinschoon/73cb4a0f2d2a6d47bc7b to your computer and use it in GitHub Desktop.
Save kevinschoon/73cb4a0f2d2a6d47bc7b to your computer and use it in GitHub Desktop.
Recursive Dropbox API Call
class FileObject:
def __init__(name, **kwargs):
self.name = name
def get_metadata(path):
resp = client.metadata(path)
for f in resp['contents']:
if f['is_file']:
yield FileObject(**f)
else:
get_metadata(f['path'])
for file_object in client.metadata('/'):
print(file_object)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment