I am writing a helper app with the python sdk to iterate through folders within a team folder and add certain child folders within specific folders that have a name matching a list of names I have.
So far I am able to iterate through the folders and match the specific folders I want, but some of the folders seem to indiscriminately not be selected from my parent folder which makes it impossible for me to automate this task because of the risk of creating redundant folders.
Here is some of my code:
names = [] # contains 100 strings of the folder names I need to match or create a folder for if not matched
# connect to dropbox
dbx = dropbox.Dropbox('access token')
# configure team space
# ref : https://stackoverflow.com/questions/75561322/dropbox-python-api-team-folder-access
root_namespace_id = dbx.users_get_current_account().root_info.root_namespace_id
dbx = dbx.with_path_root(dropbox.common.PathRoot.root(root_namespace_id))
for folder in dbx.files_list_folder('/my/path/', recursive=False).entries:
# certain folders in here are just not being listed when I check with:
# print(folder.name)
for name in names:
if name in folder.name or folder.name in name:
match.append(folder)
# working for the folders that are listed
why does
for folder in dbx.files_list_folder('/my/path/', recursive=False).entries:
not list every folder in the parent folder?
I initially thought it was only not listing folder when the "Who can access" column was listed as "Parent + others", however it seems to not list folders that are only "Parent" accessible as well.
I should note, there are 852 folders I am trying to query from and the total amount of folders I am getting is 500 from my for loop. Is this a built in constraint?
Any help would be greatly appreciated.