All Projects → samuelcolvin → xdelta3-python

samuelcolvin / xdelta3-python

Licence: other
Fast delta encoding in python using xdelta3

Programming Languages

python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to xdelta3-python

xdelta-sharp
Decompressor for delta encoding VCDIFF (RFC-3284) -- xdelta3 compatible.
Stars: ✭ 27 (-10%)
Mutual labels:  xdelta3, vcdiff, rfc-3284
vcdiff
Heavily optimized .NET Core vcdiff library
Stars: ✭ 16 (-46.67%)
Mutual labels:  xdelta3, vcdiff
xdelta3-cross-gui
A cross-platform GUI for creating xDelta3 patches, available for Windows, Linux, and Mac
Stars: ✭ 50 (+66.67%)
Mutual labels:  xdelta3
deltaq
Fast and portable delta encoding for .NET in 100% safe, managed code.
Stars: ✭ 26 (-13.33%)
Mutual labels:  vcdiff
bsdiff
Binary delta tools and library
Stars: ✭ 29 (-3.33%)
Mutual labels:  delta-encoding
dipa
dipa makes it easy to efficiently delta encode large Rust data structures.
Stars: ✭ 243 (+710%)
Mutual labels:  delta-encoding

xdelta3-python

BuildStatus Coverage pypi

Fast delta encoding in python using xdelta3.

Requirements

  • Python 3.5 or 3.6 - it's 2017, you should be using python 3.6 by now anyway.
  • linux - compilation only tested on ubuntu, might work on other platform.

Installation

pip install xdelta3

Usage

import xdelta3
value_one = b'wonderful string to demonstrate xdelta3, much of these two strings is the same.'
value_two = b'different string to demonstrate xdelta3, much of these two strings is the same.'
delta = xdelta3.encode(value_one, value_two)
# delta is an unreadable byte string: b'\xd6\xc3 ... \x01different\n\x13F\x00'

print(f'New string length: {len(value_two)}, delta length: {len(delta)}')
value_two_rebuilt = xdelta3.decode(value_one, delta)
if value_two_rebuilt == value_two:
    print('Boo Ya! Delta encoding successful.')

(with xdelta3 installed this code should run "as is", just copy it into ipython or a file and run)

How fast?

xdelta3-python is a thin wrapper around xdelta 3.1.1 which is a highly optimised c library for delta calculation and compression. It can encode a delta and decode it again for 5 small changes in a 5.5 million character string (the complete works of shakespeare) in around 10ms (or 30ms with the highest compression level). Boom. See performance.py.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].