Project libraries

You can interact with the Library of each project through the API.

Getting the DSSLibrary object

You must first retrieve the DSSLibrary through the get_library() method

project = client.get_project("MYPROJECT")
library = project.get_library()

Retrieving the content of a file

library_file = library.get_file("/file.txt")
print("Content: %s" %

# Alternate ways to retrieve a file handle
library_file = library.get_file("/python/")
library_file = library.get_folder("/python").get_file("/")

Getting the list of all the library items

def print_library_items(item):
    if "list" in dir(item):
        for child in item.list():

for item in lib.list():

Add a new folder in the library


Add a new file in the library

# create a new file in a folder
file = open("/path/to/local/file")
library.put_file("/new_folder/file.txt", file)

Rename a file or a folder in the library

# rename a file in the library

# rename a folder in the library

Move a file or a folder in the library

# move a file in the library

# move a folder in the library

Delete a file or a folder from the library


Reference documentation

class dataikuapi.dss.projectlibrary.DSSLibrary(client, project_key)

A handle to manage the library of a project It saves locally a copy of taxonomy to help navigate in the library All modifications done through this object and related library items are done locally and on remote. Note: Taxonomy modifications done outside this library are not reflected locally.

You should reload the library in this case.


Lists the contents in the given library folder or on the root if no folder is given. :param: str folder_path: the folder path (optional). If no path is given, it is defaulted to the root path. :returns: the list of contents in the library folder :rtype: list of dataikuapi.dss.projectlibrary.DSSLibraryItem


Retrieves a file in the library :param: str path: the file path :returns: the file in the given path :rtype: dataikuapi.dss.projectlibrary.DSSLibraryFile


Retrieves a folder in the library :param: str path: the folder path :returns: the folder in the given path :rtype: dataikuapi.dss.projectlibrary.DSSLibraryFolder


Create a file in the library root folder :param: str file_name: the file name :returns: the new file :rtype: dataikuapi.dss.projectlibrary.DSSLibraryFile


Create a folder in the library root folder :param: str file_name: the file name :returns: the new folder :rtype: dataikuapi.dss.projectlibrary.DSSLibraryFolder