Skip to main content

pyrsync is a Python module which implements the [rsync algorithm] [1], written in pure Python. It is not a wrapper for rsync, but a set of functions which apply full rsync functionality through Python.

The original rsync specification calls for the use of an MD5 hash, which the developers of this module considers to be outdated, and thus all occurences of MD5 have been replaced with SHA256. Personally, I would opt for using SHA512, but this would double the storage size for hash table databases. SHA256 is sufficient to meet standard security requirements for verification processes as of this release, although, eventually, added functionality for the user/developer to choose between various hashes should be considered for further releases.

The majority of the code for this module is taken from [Eric Pruitt’s post at ActiveState] [1]. It was orginally licensed under an [MIT license] [2], and this license has been kept wthout modifications.

## Installation

If you have [setuptools] [3] installed, simply do:

$ sudo python setup.py install

If you do not have setuptools, the setup.py script will detect this and default to using the python builtin distutils. To install using distutils, the installation process is the same as documented above for setuptools.

## Use

An example use case for this module:

# On the system containing the file that needs to be patched >>> import pyrsync >>> unpatched = open(“unpatched.file”, “rb”) >>> hashes = pyrsync.blockchecksums(unpatched)

# On the remote system after having received hashes >>> import pyrsync >>> patchedfile = open(“patched.file”, “rb”) >>> delta = pyrsync.rsyncdelta(patchedfile, hashes)

# System with the unpatched file after receiving delta >>> unpatched.seek(0) >>> save_to = open(“locally-patched.file”, “wb”) >>> pyrsync.patchstream(unpatched, save_to, delta)

[1]: http://samba.anu.edu.au/rsync/ “Andrew Tridgell and Paul Mackerras. The rsync algorithm. Technical Report TR-CS-96-05, Canberra 0200 ACT, Australia, 1996.” [2]: https://code.activestate.com/recipes/577518-rsync-algorithm/ “Rsync Algorithm (Python Recipe)” [3]: http://www.opensource.org/licenses/mit-license.php “OSI MIT License”

Metadata

Release files for pyrsync 0.1.0

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

Source distribution (sdist)

Source distribution for pyrsync 0.1.0
File Size Uploaded
pyrsync-0.1.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyrsync 0.1.0
File Interpreter ABI Platform
pyrsync-0.1.0.linux-x86_64-py2.6.exe Details

Total release size: 77.6 kB

Release files / pyrsync-0.1.0.tar.gz

Download URL pyrsync-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f1f4f7e61a3e13db4f13eff0ce54e1783a1b896b7b21b0e37e2ff53e468a2f8f
BLAKE2b-256 checksum
How to use checksums
f77101ffcce27e02b66d1fb5765cfec1251e0a1abb627a5d7d062e3ad180d0b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pyrsync-0.1.0.linux-x86_64-py2.6.exe

Download URL pyrsync-0.1.0.linux-x86_64-py2.6.exe
Size 72.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cdba9f08885829696337010b8288f4cae8c6a33201e998a6c56776c3ed3af35b
BLAKE2b-256 checksum
How to use checksums
f087f58099cbacc3c5ae29e843888f37236f03e5bff13b5d80855e3cd92e9038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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