How to use the onedrivesdk.Folder function in onedrivesdk

To help you get started, we’ve selected a few onedrivesdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xybu / onedrived-dev / onedrived / od_tasks / merge_dir.py View on Github external
def _get_folder_pseudo_item(item_name):
        item = Item()
        item.name = item_name
        item.folder = Folder()
        return item
github niqdev / packtpub-crawler / script / onedrive.py View on Github external
def __create_folder(self, item_id, folder_name): #Create folder with provided name
        f = onedrivesdk.Folder()
        i = onedrivesdk.Item()
        i.name = folder_name
        i.folder = f

        folder = self.__onedrive_service.item(drive='me', id=item_id).children.add(i)

        log_success('[+] creating new directory...')

        return folder.id #Return folder object ID
github xybu / onedrived-dev / onedrived / od_tasks / create_folder.py View on Github external
def _get_folder_pseudo_item(item_name):
        item = Item()
        item.name = item_name
        item.folder = Folder()
        return item
github epam / OneDrive-L / onedrive_service / src / onedrive_service / util.py View on Github external
def create_folder(self, name, parent_id=None, parent_path=None):
        """
        Create a new folder in OneDrive
        :param name: str, new folder name
        :param parent_id: str, parent id
        :param parent_path: str, parent path
        :return:
        """
        folder_to_create = onedrivesdk.Item()
        folder_to_create.name = name
        folder_to_create.folder = onedrivesdk.Folder()

        item = self.client.item(id=parent_id, path=parent_path)

        return item.children.add(folder_to_create)