Skip to main content

cloudsync enables simple cloud file-level sync with a variety of cloud providers

Project description

cloudsync

Python Cloud Synchronization Library

pip install cloudsync

Example:

from cloudsync import CloudSync, CloudSyncProvider

local = CloudSyncProvider("local", path="/usr/home/alice/test", monitor=True)

remote = CloudSyncProvider("gdrive", path="/test-folder")

remote.connect()

sync = CloudSync(local, remote)

sync.start()

with open("/usr/home/alice/test/hello.txt", "w") as f:
    f.write("hello")

# give the monitor a second to notice the change
# alternatively we can "poke" the local provider, forcing a sync

time.sleep(1)

sync.wait(timeout=10)

# using no_poke to deliberately trick our sync into *not* knowing about the rename 
remote.rename("/test-folder/hello.txt", "/test-folder/goodbye.txt", no_poke=True)

# we should still sync properly because of the event cursor
while not os.path.exists("/usr/home/alice/test/goodbye.txt"):
    time.sleep(1)

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.1.4a1.tar.gz (116.7 kB view hashes)

Uploaded Source

Built Distribution

cloudsync-1.1.4a1-py3-none-any.whl (483.9 kB view hashes)

Uploaded Python 3

Supported by

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