cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Dropbox equivalent of os.walk() for python

Dropbox equivalent of os.walk() for python

abhannan
Explorer | Level 4
Go to solution

Hi,

I'm looking to list all the files in folders and sub-folders of one dropbox account with Python v2 API. Is there any equivalent of os.walk() in the API? I can see that we have files_list_folder() but this does not list the files in sub-folders.

Also is there any function in the API which provides the file types, for example, .mp3 or .jpg. If not then I have to do python magic to extract this information.

Thanks

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

If you need to list all entries, included nested files and folders, you should use files_list_folder and files_list_folder_continue. You can do so by setting recursive=True on the initial call to files_list_folder.

 

The Dropbox API doesn't offer a way to automatically retrieve the file extension, so you should extract that from the name or path.

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff
Go to solution

If you need to list all entries, included nested files and folders, you should use files_list_folder and files_list_folder_continue. You can do so by setting recursive=True on the initial call to files_list_folder.

 

The Dropbox API doesn't offer a way to automatically retrieve the file extension, so you should extract that from the name or path.

steve-the-bayes
New member | Level 2
Go to solution

Links to docs are either broken or were never populated.    They lead to:

        \          SORRY            /
         \                         /
          \    This page does     /
           ]   not exist yet.    [    ,'|
           ]                     [   /  |
           ]___               ___[ ,'   |
           ]  ]\             /[  [ |:   |
           ]  ] \           / [  [ |:   |
           ]  ]  ]         [  [  [ |:   |
           ]  ]  ]__     __[  [  [ |:   |
           ]  ]  ] ]\ _ /[ [  [  [ |:   |
           ]  ]  ] ] (#) [ [  [  [ :===='
           ]  ]  ]_].nHn.[_[  [  [
           ]  ]  ]  HHHHH. [  [  [
           ]  ] /   `HH("N  \ [  [
           ]__]/     HHH  "  \[__[
           ]         NNN         [
           ]         N/"         [
           ]         N H         [
          /          N            \
         /           q,            \
        /                           \
 

Greg-DB
Dropbox Staff
Go to solution

@steve-the-bayes Thanks for letting me know! I've fixed the documentation links in my earlier message.

Need more support?