Skip to main content

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


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.3.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wcpan.drive.core-1.0.3-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file wcpan.drive.core-1.0.3.tar.gz.

File metadata

  • Download URL: wcpan.drive.core-1.0.3.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for wcpan.drive.core-1.0.3.tar.gz
Algorithm Hash digest
SHA256 4926d48d6bc13d7217591ac76a1dc5026a1e46222385250fdc4025da1f193321
MD5 b71545e14702932bbb9641976cbdc0d8
BLAKE2b-256 9f3d9ba14703754228daeb60c009b71a32f969364f4df198fa8c92311e5299e1

See more details on using hashes here.

File details

Details for the file wcpan.drive.core-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: wcpan.drive.core-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for wcpan.drive.core-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2e0f3558e85b36e422735380a6c9628a1648e863928ab60b21b3665cc88e5a68
MD5 6108d4b897b522179bf0469a2230be3f
BLAKE2b-256 25cf83a8546d26153d9e32230eaf5098d6d26f74b25785cce7073a8e753a360e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page