Skip to main content

python binding for qbdiff

Project description

✨ pyqbdiff ✨

The python binding for qbdiff

pypi python implementation wheel license action

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


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.tar.gz (476.0 kB view details)

Uploaded Source

Built Distribution

qbdiff-0.0.1-cp310-cp310-win_amd64.whl (389.7 kB view details)

Uploaded CPython 3.10 Windows x86-64

File details

Details for the file qbdiff-0.0.1.tar.gz.

File metadata

  • Download URL: qbdiff-0.0.1.tar.gz
  • Upload date:
  • Size: 476.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for qbdiff-0.0.1.tar.gz
Algorithm Hash digest
SHA256 59996d7e537dc1bcd4e17a8a6c8578cdd000947ec6a22bde8f69a9f1c17d0b2b
MD5 b8541a1d016a73dfe9396dc055e060d2
BLAKE2b-256 b6feaadc2bf300af9f42355e3aedc3ddb6fbf2067b62d4e698c6639a7a2776ad

See more details on using hashes here.

File details

Details for the file qbdiff-0.0.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: qbdiff-0.0.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 389.7 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for qbdiff-0.0.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6432f0ef6fc7ba3e5d1cfb06cb917282f91af4ea300d43220bcacaf3d02a46b9
MD5 ab1c46184cc01e0a0dac0f0a72ed119c
BLAKE2b-256 d26b0da8957d9275b2c2affbe074659b7f2599f6f93220cd6863af2e23dd277a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page