Git Product home page Git Product logo

pyrsync's Introduction

=============================== #pyrsync

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] 2. It was orginally licensed under an [MIT license] 3, and this license has been kept wthout modifications.

Installation


If you have [setuptools] 4 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)

pyrsync's People

Contributors

isislovecruft avatar mrshu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.