TinySync README
TinySync
TinySync is a two-way synchronization algorithm implemented in pure Python, enabling file synchronization between any two types of backends. A backend can be a local file system, a WebDAV server, or any other user-defined storage medium. The synchronization algorithm is adapted from the syncrclone project. In principle, this project is compatible with all operating systems, though most testing has been performed on Ubuntu.
Installation
pip install tinysync
Examples
Synchronization between Local Directory and WebDAV
This example illustrates how to synchronize a remote WebDAV storage with a local directory.
import tinysync
# set a local dir
backendA = tinysync.backend.LocalFS(dirPath="/home/XXX/Desktop/p1")
# set another backend on webdav
options = {'webdav_hostname': "...",'webdav_login': "...",'webdav_password':"..."}
backendB = tinysync.backend._WebDAV(dirPath='p2',options=options)
# run sync method
tinysync.synchronization(backendA,backendB)
Synchronization between Local Directory and SSH Server
This example demonstrates file synchronization between a local directory and a remote directory on an SSH server.
import tinysync
# set one backend
config={"hostname":'...',"username":'...',"password":'...',}
remote_path = '/home/user/path' # the remote directory to list
backendA = tinysync.backend.NixSSH(dirPath=remote_path,paramikoConfig=config)
# set another backend
options = {'webdav_hostname':"...",'webdav_login':"...",'webdav_password':"...",}
backendB = tinysync.backend._WebDAV(dirPath='p2',options=options)
# run sync method
tinysync.synchronization(backendA,backendB)
Synchronization between Any Two Backends
This feature supports synchronization between any two remote storage locations. The machine executing this code acts as a "working machine" and does not retain any information about the two backends. All state data is stored on the backend side.
Other Backends
Rclone example:
rclone = tinysync.backend.Rclone(dirPath="disk:path/to/here")
User-defined Backend
For general use cases, you can define a custom backend interface by creating a new backend class. Detailed methods and implementation examples are available in tinysync.backend.abc.
from tinysync.backend.abc import Backend
class YourBackend(Backend):
def __init__(...):
...
def listPath(self,...):
...
...
Notice
Do NOT delete the workdir (default: .tinysync) from one backend while retaining it on the other. This will result in the deletion of all files in the backend where the workdir was retained. This behavior, inherited from syncrclone, is not ideal, but it will not be modified. To perform a full resynchronization, it is safe to delete the workdir from both backends.
Currently Implemented Backends
-
tinysync.backend.LocalFS -
tinysync.backend._WebDAV -
tinysync.backend.NixSSH -
tinysync.backend.FTP(Example:FTP(dirPath="", host='127.0.0.1', username='123', password='456')) -
tinysync.backend.Rclone(consider using syncrclone)
More backends coming soon...
Metadata
Release files for tinysync 0.0.22
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tinysync-0.0.22-py3-none-any.whl | Python 3 | none | any | Details for tinysync-0.0.22-py3-none-any.whl |
Release files / tinysync-0.0.22-py3-none-any.whl
| Download URL | tinysync-0.0.22-py3-none-any.whl |
|---|---|
| Size | 55.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
30bb1f2e3257b012ac65c12af48ff06183ed7fae9c376df33aabd4167809cc76
|
|
BLAKE2b-256 checksum How to use checksums |
80468c20eb2b82dd635856c53f4181685d43482d54ff91766e2447ff86c29820
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for tinysync 0.0.22
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.