cloudsync enables simple cloud file-level sync with a variety of cloud providers
Project description
cloudsync README
Python Cloud Synchronization Library
Installation
pip install cloudsync
Links
Example
import cloudsync
# local file provide + gdrive provider
local = cloudsync.get_provider("file")
remote = cloudsync.get_provider("gdrive")
# oauth
creds = remote.authorize()
# connect with creds
remote.connect(creds)
# root for sync
roots = ("/home/me/gd", "/")
# new sync engine
sync = cloudsync.CloudSync((local, remote), roots)
sync.start()
# should sync this file as soon as it's noticed by watchdog
with open("/home/me/gd/hello.txt", "w") as f:
f.write("hello")
# wait for sync
while not remote.exists_path("/home/alice/hello.txt"):
time.sleep(1)
# rename in the cloud
remote.rename("/hello.txt", "/goodbye.txt")
# wait for sync
while not local.exists_path("/home/alice/goodbye.txt"):
time.sleep(1)
print("synced")
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
cloudsync-1.3.22a2.tar.gz
(189.5 kB
view details)
Built Distribution
cloudsync-1.3.22a2-py3-none-any.whl
(183.3 kB
view details)
File details
Details for the file cloudsync-1.3.22a2.tar.gz
.
File metadata
- Download URL: cloudsync-1.3.22a2.tar.gz
- Upload date:
- Size: 189.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.22.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ce30f15bd647efefaa8cd5b4abce76896b50fa219c1b83d76c6561a61fb79ab |
|
MD5 | 8cd882eec66224ce1fbc79a14856f4b0 |
|
BLAKE2b-256 | b3259051c87ee834116501af9b76f542ebfb086c2fa8f43a015db0a2e9455fc2 |
File details
Details for the file cloudsync-1.3.22a2-py3-none-any.whl
.
File metadata
- Download URL: cloudsync-1.3.22a2-py3-none-any.whl
- Upload date:
- Size: 183.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.22.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1509ba0b698ffd6861fe7b4fde74c5fefc393e37f8f229de3fbda323a9dcba9e |
|
MD5 | 768d3a0a6569c130fdc2eada1fc6f8fa |
|
BLAKE2b-256 | c04a8e8614660fe17a9f2db99710baa9f47c86563171f3db41dd002a11265ad6 |