'Given an iterable of path components and a parent folder id, recursively
create directories below parent_folder_id'

def recursively_build_path(self, path_parts, parent_folder_id, ids=None):

    if (ids is None):
        ids = []
    if (len(path_parts) == 0):
        return ids
    else:
        pf = self.gi.libraries.create_folder(self.library_id, path_parts[0], base_folder_id=parent_folder_id)
        ids.append(pf[0]['id'])
        return self.recursively_build_path(path_parts[1:], pf[0]['id'], ids=ids)
