Metadata-Version: 2.4
Name: wcpan-drive-core
Version: 5.0.2
Summary: asynchronous generic cloud drive library
Project-URL: source, https://github.com/legnaleurc/wcpan.drive.core
Author-email: Wei-Cheng Pan <legnaleurc@gmail.com>
License: MIT
License-File: LICENSE.txt
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: <4.0,>=3.12
Description-Content-Type: text/markdown

# wcpan.drive.core

Asynchronous generic cloud drive library.

This package provides the core abstractions only. It requires a
`SnapshotService` and `FileService` implementation to work.

## Documentation

See the full documentation on [Read the Docs](https://wcpandrivecore.readthedocs.io/).

## Quick Example

```python
from wcpan.drive.core import create_drive
from wcpan.drive.core.lib import download_file_to_local, upload_file_from_local

async with create_drive(
    file=create_my_file_service,
    snapshot=create_my_snapshot_service,
) as drive:
    if not await drive.is_authenticated():
        await drive.authenticate()

    async for change in drive.sync():
        print(change)

    root = await drive.get_root()
    node = await upload_file_from_local(drive, local_path, root)
    await download_file_to_local(drive, node, dest_dir)
```
