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.
Metadata
Release files for xdelta3 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xdelta3-0.0.5.tar.gz | 122.1 kB | Without provenance | Details for xdelta3-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xdelta3-0.0.5-cp36-cp36m-any.whl | CPython 3.6 | CPython 3.6 pymalloc | any | Details for xdelta3-0.0.5-cp36-cp36m-any.whl |
Total release size: 407.4 kB
Release files / xdelta3-0.0.5.tar.gz
| Download URL | xdelta3-0.0.5.tar.gz |
|---|---|
| Size | 122.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ea6ca56805466274bb2095cbd1ac7f908f00789b467b92fea4d4a282ccf003e
|
|
BLAKE2b-256 checksum How to use checksums |
9a2e18a4011d94e3a557be8b632f7d73b6d5e06998638f90c45c131bdf8edeb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / xdelta3-0.0.5-cp36-cp36m-any.whl
| Download URL | xdelta3-0.0.5-cp36-cp36m-any.whl |
|---|---|
| Size | 285.3 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc |
|
SHA-256 checksum How to use checksums |
affb4907cd71f3821115d67a71d0a72a5690213089a79c843fb34abf904ba396
|
|
BLAKE2b-256 checksum How to use checksums |
3c0d65e3795bab2c0db17625ac5c968b51c1caed0e1d8e5c28dad704f9d939fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for xdelta3 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.