with SynologyDrive ( NAS_USER, NAS_PASS, NAS_IP, dsm_version = '7' ) as synd : synd. from synology_drive_api.drive import SynologyDrive # default http port is 5000, https is 5001. If you use dsm 7, default dsm_version is '6'. list_folder ( '/mydrive' ) # write your code here upload_file ( file, dest_folder_path = dest_folder_path ) # write your code here # disable label cache with SynologyDrive ( NAS_USER, NAS_PASS, drive_path_demo, enable_label_cache = False ) as synd : synd. list_folder ( '/mydrive' ) # write your code here # use domain name or name + path access drive # Enabled in Application Portal | Application | Drive | General | Enable customized alias drive_path_demo = 'your_nas_domain/drive' # Enabled in Application Portal | Application | Drive | General | Enable customized domain drive_path_demo2 = 'your_drive_domain' with SynologyDrive ( NAS_USER, NAS_PASS, drive_path_demo ) as synd : synd. with SynologyDrive ( NAS_USER, NAS_PASS, otp_code = 'XXXXXX' ) as synd : synd. create_folder ( 'test', 'team-folder/folder2/' ) # write your code here # Enable 2fa. with SynologyDrive ( NAS_USER, NAS_PASS, NAS_IP, https = False ) as synd : synd. get_file_or_folder_info ( path_or_path_id ) # write your code here # use http instead of https. list_folder ( '/mydrive' ) # write your code here # Use specified port with SynologyDrive ( NAS_USER, NAS_PASS, NAS_IP, NAS_PORT ) as synd : synd. with SynologyDrive ( NAS_USER, NAS_PASS, NAS_IP ) as synd : synd. if you need multiple login session and label functions, disable label cache. Synology Drive allows same user with multiple login session. You can access drive by IP, drive domain or nas domain + drive path. Installation pip install synology-drive-api By means of Synology Office, you can edit spreadsheet on Drive and use this api wrapper read spreadsheet. It helps you manage your files/folders/labels in synology drive. This repo is aimed at providing Synology drive api wrapper and related helper functions. Synology-drive-api is inspired by synology-api.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |