异步通用云驱动器库
wcpan.drive.core的Python项目详细描述
在wcpan.drive在
异步通用云驱动器库。在
这个软件包需要一个驱动程序才能真正使用云驱动程序。在
示例用法
fromwcpan.drive.core.driveimportDriveFactoryfromwcpan.drive.core.utilimportdownload_to_localasyncdefapi_demo():# setup environmentfactory=DriveFactory()# read config file from here# default is $HOME/.config/wcpan/drivefactory.config_path='/tmp/config'# put data file to here# default is $HOME/.local/share/wcpan/drivefactory.data_path='/tmp/data'# setup cache database, will write to data folderfactory.database='nodes.sqlite'# setup driver classfactory.driver='wcpan.drive.google.driver.GoogleDriver'# load config file from config folder# this will not overwrite given valuesfactory.load_config()asyncwithfactory()asdrive:# it is important to keep cache in syncasyncforchangeindrive.sync():print(change)# download filenode=awaitdrive.get_node_by_path('/path/to/drive/file')download_to_local(drive,node,'/tmp')
- 项目
标签: