Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samuelcolvin/xdelta3-python
Fast delta encoding in python using xdelta3
https://github.com/samuelcolvin/xdelta3-python
c delta-encoding python python3 rfc-3284 vcdiff xdelta3
Last synced: about 1 month ago
JSON representation
Fast delta encoding in python using xdelta3
- Host: GitHub
- URL: https://github.com/samuelcolvin/xdelta3-python
- Owner: samuelcolvin
- License: other
- Archived: true
- Created: 2017-05-13T18:28:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-10-28T19:17:14.000Z (about 3 years ago)
- Last Synced: 2024-09-25T19:28:54.868Z (about 1 month ago)
- Topics: c, delta-encoding, python, python3, rfc-3284, vcdiff, xdelta3
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 34
- Watchers: 6
- Forks: 15
- Open Issues: 10
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
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
------------.. code:: shell
pip install xdelta3
Usage
-----.. code:: python
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 `_... |BuildStatus| image:: https://travis-ci.org/samuelcolvin/xdelta3-python.svg?branch=master
:target: https://travis-ci.org/samuelcolvin/xdelta3-python
.. |Coverage| image:: https://codecov.io/gh/samuelcolvin/xdelta3-python/branch/master/graph/badge.svg
:target: https://codecov.io/gh/samuelcolvin/xdelta3-python
.. |pypi| image:: https://img.shields.io/pypi/v/xdelta3.svg
:target: https://pypi.python.org/pypi/xdelta3