cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We are making some updates so the Community might be down for a few hours on Monday the 11th of November. Apologies for the inconvenience and thank you for your patience. You can find out 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: 

Dropbox equivalent of os.walk() for python

Dropbox equivalent of os.walk() for python

abhannan
Helpful | Level 5
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?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    steve-the-bayes New member | Level 2
What do Dropbox user levels mean?