Skip to main content

blocksync

This library allows blocksync script to be used as Python package, and supports more convenient and various functions than blocksync script.

Build PyPi PyVersions

Prerequisites

  • Python 3.8 or later

Features

  • Synchronize the destination (remote or local) files using an incremental algorithm.
  • Supports all synchronization directions. (local-local, local-remote, remote-local)
  • Support for callbacks that can run before(run once or per workers), after(run once or per workers), and during synchronization of files
  • Support for synchronization suspend/resume, cancel.
  • Most methods support method chaining.
  • You can see the overall progress in a multi-threaded environment.
  • You can proceed synchronization in the background.
  • You can specify the number of workers (number of threads) to perform synchronization.

Installation

pip install blocksync

Quick start

When sync from/to remote, you can check the SSH connection options in paramiko docs.

from blocksync import local_to_local


manager, status = local_to_local("src.txt", "dest.txt", workers=4)
manager.wait_sync()
print(status)

# Output
[Worker 1]: Start sync(src.txt -> dest.txt) 1 blocks
[Worker 2]: Start sync(src.txt -> dest.txt) 1 blocks
[Worker 3]: Start sync(src.txt -> dest.txt) 1 blocks
[Worker 4]: Start sync(src.txt -> dest.txt) 1 blocks
{'workers': 4, 'chunk_size': 250, 'block_size': 250, 'src_size': 1000, 'dest_size': 1000, 'blocks': {'same': 4, 'diff': 0, 'done': 4}}

TODO

  • Provide CLI
  • Write docs and build a docs website

License

MIT License (For more information about this license, please see this)

Metadata

Release files for blocksync 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for blocksync 3.0.1
File Size Uploaded Provenance
blocksync-3.0.1.tar.gz 9.2 kB Without provenance Details

Release files / blocksync-3.0.1.tar.gz

Download URL blocksync-3.0.1.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d519c9085b8649afe70a27f4c686429978e3042b2dee06c9b515cfa78451f83d
BLAKE2b-256 checksum
How to use checksums
5d4bd41f350555a9b2ac915e61fc63a2026925bc1fc0a9a17755fa52c4ecd6ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.7

Security for blocksync 3.0.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page