Skip to main content

Fast delta encoding using xdelta3

Project description

BuildStatus Coverage pypi

Fast delta encoding in python using xdelta3.


  • 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.


pip install xdelta3


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)

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.')

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.4M character string (the complete works of shakespeare) in around 30ms. Boom. See

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for xdelta3, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size xdelta3-0.0.3.tar.gz (121.0 kB) File type Source Python version None Upload date Hashes View
Filename, size xdelta3-0.0.3-cp36-cp36m-any.whl (258.4 kB) File type Wheel Python version 3.6 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page