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
# install provider support
pip install cloudsync-gdrive
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.4.5.tar.gz
(193.7 kB
view hashes)
Built Distribution
cloudsync-1.4.5-py3-none-any.whl
(167.8 kB
view hashes)
Close
Hashes for cloudsync-1.4.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aef6cc1743f0a1aaf37ae5b00559764d70e5458570cc3bf5266126708d789fa6 |
|
MD5 | 96d7ce1cdbc63e7319745d5a8b30fc49 |
|
BLAKE2b-256 | 32b9013f086724f50da6b5b7cf3b590f98aeef3abb0f45e565d41e31ff1eac88 |