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.1.tar.gz (14.5 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.1-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wcpan.drive.core-1.0.1.tar.gz
  • Upload date:
  • Size: 14.5 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

Hashes for wcpan.drive.core-1.0.1.tar.gz
Algorithm Hash digest
SHA256 dc65a43f1ed80ef4d22f23123eab1a62b91da356b6863595b615646f72a5bccc
MD5 ee438fcf2fd4605f9de135e74f2900f7
BLAKE2b-256 e0e104594ca68f253ee86ec531d56e4f209b98434a9ff9d46106e6930448ce56

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wcpan.drive.core-1.0.1-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

Hashes for wcpan.drive.core-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0196d918d65ebd240cb7d1435919259772c3ecb47aee859af54d28dd3b7d0c79
MD5 0d0f33a5b79a4f3a2eabbf0484d7f3f8
BLAKE2b-256 38d683e081a7f7bf6e374ebeb21711827b6146bf9ee634cea8e4902888e57933

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