You can interact with project folders through the API.
The ROOT project folder can be retrieved with the
root_folder = client.get_root_project_folder()
Alternatively any project folder can be retrieved with its ID with the
prj_folder = client.get_project_folder(prj_folder_id)
Getting basic attributes:
# Getting the id of a project folder (for "get_project_folder") id = prj_folder.id # Getting the name of a project folder: name = prj_folder.name # Getting the "virtual path" of a project folder (NB: for information purpose only, does not hold special significance) path = prj_folder.get_path()
Finding the folder of a project#
From a project, you can find its project folder
project = client.get_project("MYPROJECT") folder = project.get_project_folder() print("Project is in folder %s (path %s)" % (folder.name, folder.get_path()))
To create a child project folder, use the
# Creating a new project folder newborn_child = prj_folder.create_sub_folder(project_folder_name) # Creating a project directly into a project folder new_project = prj_folder.create_project(project_key, project_name, owner)
To move a project folder to another location (into another project folder), use the
prj_folder.move_to(new_parent) prj_folder.move_project_to(project_key, new_parent)
You can also move a project directly
Managing project folders#
Deleting a project folder#
pf_settings = prj_folder.get_settings() pf_settings.set_name(new_name) pf_settings.set_owner(new_owner) pf_permissions = pf_settings.get_permissions() pf_permissions.append(new_permission_item) pf_settings.save()
A handle for a project folder on the DSS instance.
A handle for a project folder settings.