python binding for qbdiff
Project description
✨ 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_CFFI
env 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qbdiff-0.0.1.dev1.tar.gz
(474.7 kB
view hashes)
Built Distribution
qbdiff-0.0.1.dev1-py3-none-any.whl
(389.5 kB
view hashes)
Close
Hashes for qbdiff-0.0.1.dev1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b80c0096cce7e7411e99c6d6b501eea797a8b5e6100599408f2438d7ea6bd62 |
|
MD5 | c9ec4ad5c8c691adf81be872a05a5669 |
|
BLAKE2b-256 | 4ebaa14032f30a6f78edac3ceca3e9ee92b8289e38ffbdaf95a8bb4e41e789ad |