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.0.0.tar.gz
(14.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wcpan.drive.core-1.0.0.tar.gz.
File metadata
- Download URL: wcpan.drive.core-1.0.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fad0bae76219f5ec17a4c39053537a6bd807ff2f74822c07d9bb7ffde1c95910
|
|
| MD5 |
4cc9bd82b826fd0e4738d1605bbbba89
|
|
| BLAKE2b-256 |
a3327cc3f286dc72658467a7cd69712b4f40caa1470b2c5780957d8264a2f60a
|
File details
Details for the file wcpan.drive.core-1.0.0-py3-none-any.whl.
File metadata
- Download URL: wcpan.drive.core-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1445fbd53e68f3aeb789088dad1da0ddf5010b9d44cca08e5de0a004e7c4862
|
|
| MD5 |
8e00046cbd111d7436b27e0924f8fccd
|
|
| BLAKE2b-256 |
5da7a8bf8bf53d6749632d09620a769df85dfff992b9e6f4fd00ad3d03b5ee8d
|