Pysync ------ Pysync is a demonstration implementation of the rsync algorithm in Python. It is not fast and is not optimized, however it does work and is very simple. The primary aim is to provide a simple implementation of the algorithm for reference and experimentation, thus code clarity has been given a higher priority than performance. It includes a combination of ideas taken from librsync, xdelta, and rsync. It now also includes an md4 extension module, a rollsum extension module, and a librsync extension module built using swig. The librsync extension module is a very fast alternative for use in real world applications. The original Python pysync module is best for demonstrating and experimenting with the algorithm. The md4 and rollsum modules provide fast utilities for the pysync module. Both 'pysync.py' and 'librsync.py' are their own best documentation. Both can be executed with Python as general purpose file signature/delta/patch utilities similar to the rdiff utility that comes with librsync. Note that the librsync and pysync delta and signature files are not compatible. The librsync signature and delta files are compatible with the librsync rdiff utility. INSTALLATION ------------ Pysync is available as binary and source packages for both Windows and Linux. The binary packages and windows source package have been build using pythons distutils. The windows source archive includes everything needed to build on windows using distutils and MSVC. The unix source package does not include librsync, but includes everything required to build pysync from scratch using swig, distutils, make etc. Windows Binary: Get and run the pysync Windows installer. Linux Binary: Get and install the pysync Linux rpm. Debian users can use 'alien' to convert it to a deb. Windows Source: Get and extract the pysync .zip source archive. In the directory where you extracted pysync, run "python setup.py bdist_wininst". This will compile and create a Windows installer in the "dist" directory. Unix Source: Get and extract the pysync .tar.bz2 source archive. Get and extract the librsync source into a directory 'librsync' off the pysync directory. In the pysync directory run "make". This will configure librsync, run swig to generate the librsync wrapper, and compile and generate dumb source and binary packages in the "dist" directory. Check the Makefile for other build and clean options. pysync module ------------- The pysync module includes low level, high level, and file level API's. The source of pysync.py includes extensive documentation that explains it very clearly. The test code included is a good example of how it can be used. librsync module --------------- The librsync module is a swig wrapper around the librsync library. This wrapper includes both low level and file level API's. The swig generated documentation "librsync_wrap.doc" summarises the available classes and methods. The swig generated shadow class librsync.py includes test code that is a good example of how the file level API works. The file level API allows signature, delta and patch operations on Python Files. This API is identical to the file level API of pysync. It should work on any Python File type object that can be converted to a real file handle, including things like sockets. Unfortunately the low level incremental API does not yet work. Anyone with more experience getting swig callbacks to work are welcome to help fix this. The incremental delta and patch operation is broken, but the signature generation and loading appears to work. md4sum module ------------- The md4sum directory contains a md4 extension module. This module was created simply by getting the files md4c.c and md4.h from libmd-0.3 , and generating md4module.c by running; sed 's/\(md\)5/\14/i' md4module.c This works because the RSA md5 code used by Python has an identical API to the RSA md4 code. The md4.h header was also fixed slightly for windows compiling. rollsum module ------------- The rollsum directory contains a rollsum extension module that implements the librsync rolling checksum. This module was based on the md5 extension module and has the same API as the provided adler32 module. Earlier releases of pysync used the adler32 module, but now use the much faster rollsum extension module. An early implementation using a swig wrapper proved to provide minimal speedups over the adler32 module and was abandoned. The swig wrapper code is not included in pysync but is available on request. adler32 module -------------- The adler32 module is a pure python adler32 implementation with an API similar to the Python md5 module, but with extensions to support "rolling". This module is not used by pysync any more, but is provided for reference and experimenting. Brief experiments with pyrex before rollsum was implemented were interesting but failed to provide any speed increases. The pyrex source is not included in pysync but is available on request. CONTACTS -------- The librsync library is hosted on sourceforge as part of the rproxy project . The librsync swig wrapper development was kindly sponsored by Accellion . Pysync is mantained by Donovan Baarda . The freshmeat appindex entry serves as the project's homepage. Please email any comments/suggestions/complaints to me, or leave a comment on the freshmeat appindex entry . Donovan Baarda http://sourceforge.net/users/abo/