Open
Description
Using the iPython OSF object, it is very slow to walk through a tree structure of folders in order to index the data repo.
import osfclient
client = osfclient.OSF()
proj = client.project('url_id')
def build_folder_tree(folder):
subfolders = list(folder.folders)
tree = {}
for sub in subfolders:
tree_sub = build_folder_tree(sub)
tree[sub.name] = tree_sub
if tree == {}:
tree = (f for f in folder.files)
return tree
tree = build_folder_tree(proj.storage())
Is there an easier way to build a hierarchical index of a project repo so that one can quickly
Metadata
Metadata
Assignees
Labels
No labels