✨ pyqbdiff ✨
The python binding for qbdiff
install
pip install qbdiff
Usage
from qbdiff import compute, patch, version, error
old = b"1234"
new_ = b"123456"
compute(old, new_, "diff_tmp.bin")
with open("diff_tmp.bin", "rb") as f:
diff = f.read()
patch(old, diff, "new.bin")
with open("new.bin", "rb") as f:
newf = f.read()
assert new_ == newf
- use
QBDIFF_USE_CFFIenv var to specify a backend
Public functions
QBERR_BADCKSUM: int
QBERR_BADPATCH: int
QBERR_IOERR: int
QBERR_LZMAERR: int
QBERR_NOMEM: int
QBERR_OK: int
QBERR_SAIS: int
QBERR_TRUNCPATCH: int
def version() -> str: ...
def error(code: int) -> str: ...
def compute(old: bytes, new_: bytes, diff_file: str) -> int: ...
def patch(old: bytes, patch_: bytes, new_file: str) -> int: ...
Build
Two env var is needed to build, LIB and INCLUDE. LIB is the path of liblzma.lib/liblzma.so,
and INCLUDE is the directory of lzma.h
git submodule update --init --recursive
python setup.py sdist bdist_wheel --use-cython --use-cffi
Metadata
Release files for qbdiff 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qbdiff-0.0.1.tar.gz | 476.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qbdiff-0.0.1-cp310-cp310-win_amd64.whl | CPython 3.10 | CPython 3.10 | Windows x86-64 | Details |
Total release size: 865.6 kB
Release files / qbdiff-0.0.1.tar.gz
| Download URL | qbdiff-0.0.1.tar.gz |
|---|---|
| Size | 476.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59996d7e537dc1bcd4e17a8a6c8578cdd000947ec6a22bde8f69a9f1c17d0b2b
|
|
BLAKE2b-256 checksum How to use checksums |
b6feaadc2bf300af9f42355e3aedc3ddb6fbf2067b62d4e698c6639a7a2776ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / qbdiff-0.0.1-cp310-cp310-win_amd64.whl
| Download URL | qbdiff-0.0.1-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 389.7 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6432f0ef6fc7ba3e5d1cfb06cb917282f91af4ea300d43220bcacaf3d02a46b9
|
|
BLAKE2b-256 checksum How to use checksums |
d26b0da8957d9275b2c2affbe074659b7f2599f6f93220cd6863af2e23dd277a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|