asynchronous generic cloud drive library
Project description
wcpan.drive
Asynchronous generic cloud drive library.
This package needs a driver to actually work with a cloud drive.
Example Usage
from wcpan.drive.core.drive import DriveFactory
from wcpan.drive.core.util import download_to_local
async def api_demo():
# setup environment
factory = DriveFactory()
# read config file from here
# default is $HOME/.config/wcpan/drive
factory.config_path = '/tmp/config'
# put data file to here
# default is $HOME/.local/share/wcpan/drive
factory.data_path = '/tmp/data'
# setup cache database, will write to data folder
factory.database = 'nodes.sqlite'
# setup driver class
factory.driver = 'wcpan.drive.google.driver.GoogleDriver'
# load config file from config folder
# this will not overwrite given values
factory.load_config()
async with factory() as drive:
# it is important to keep cache in sync
async for change in drive.sync():
print(change)
# download file
node = await drive.get_node_by_path('/path/to/drive/file')
download_to_local(drive, node, '/tmp')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wcpan.drive.core-1.1.0.tar.gz
(15.2 kB
view hashes)
Built Distribution
Close
Hashes for wcpan.drive.core-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09a21d1cfb7d2db2603cecbab80ed718ab90ba4f7d88598dca286cfdf89a06ff |
|
MD5 | b4c05c6afac84a461978b4200854f132 |
|
BLAKE2b-256 | 45f0c2d3181779781c332931433f7cbb3e7adc8889f4ebb5e8662decbead46f8 |