You can interact with project folders through the API.
The ROOT project folder can be retrieved with the get_root_project_folder method.
root_folder = client.get_root_project_folder()
Alternatively any project folder can be retrieved with its ID with the get_project_folder method.
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()
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 create_sub_folder method.
# 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 move_to method.
prj_folder.move_to(new_parent) prj_folder.move_project_to(project_key, new_parent)
You can also move a project directly
A handle to interact with a project folder on the DSS instance.
Get this project folder’s id :returns str: the id of this project folder
Get this project folder’s name or None if it is the root project folder :returns str: the name of this project folders or None for the root project folder
Get this project folder’s path from the orot, in the form of /name/name/name :return str: the path of this project folder
Get this project folder’s parent or None if it is the root project folder
dataikuapi.dss.projectfolders.DSSProjectFolderto interact with its parent or None for the root project folder
List the child project folders inside this project folder :returns list: A list of
dataikuapi.dss.projectfolders.DSSProjectFolderto interact with its sub-folders
List the project keys of the projects that are stored in this project folder :returns list: A list of project keys
List the projects that are stored in this project folder :returns list: A list of
dataikuapi.dss.project.DSSProjectto interact with its projects
Delete the project folder Note: it must be empty (cannot contain any sub-project folders or projects), you must move or remove all its content before deleting it
This call requires an API key with admin rights
dataikuapi.dss.projectfolder.DSSProjectFolderSettingsto interact with this project folder settings
Create a sub-folder into the current project folder
Parameters: name (str) – the name of the project folder to create Returns: A
dataikuapi.dss.projectfolder.DSSProjectFolderto interact with the newly created project folder
create_project(project_key, name, owner, description=None, settings=None)¶
Creates a new project within this project folder, and return a project handle to interact with it.
Note: this call requires an API key with admin rights or the rights to create a project
- project_key (str) – the identifier to use for the project. Must be globally unique
- name (str) – the display name for the project.
- owner (str) – the login of the owner of the project.
- description (str) – a description for the project.
- settings (dict) – Initial settings for the project (can be modified later). The exact possible settings are not documented.
A class:dataikuapi.dss.project.DSSProject project handle to interact with this project
Move this project folder into another project folder (aka. destination)
Parameters: destination (A
dataikuapi.dss.projectfolders.DSSProjectFolder) – the project folder to put this project folder into
Move a project within this project folder into another project folder (aka. destination)
- project_key (str) – the project key associated with the project to move
- destination (A
dataikuapi.dss.projectfolders.DSSProjectFolder) – the project folder to put this project into
DSSProjectFolderSettings(client, project_folder_id, settings)¶
A handle to interact with project folder settings
Do not create this class directly, instead use
Gets all settings as a raw dictionary. This returns a reference to the raw retrieved settings, not a copy, so changes made to the returned object will be reflected when saving.
Return type: dict
Get the name of the project folder
Returns str: the current name of the project folder
Set the name of the project folder
Parameters: name (str) – the new name of the project folder
Get the login of the owner of the project folder
Returns str: the current login owner of the project folder
Set the owner of the project folder
Parameters: owner (str) – the new owner login of the project folder
Get the permissions of the project folder. This returns a reference to the retrieved permissions, not a copy, so changes made to the returned list will be reflected when saving.
Return list: the current permissions of the project folder
Saves back the settings to the project folder