python binding for librsync
Project description
✨ pyrsync ✨
The python binding for librsync
Install
pip install python-rsync
Usage
from io import BytesIO
from pyrsync import delta, get_signature_args, signature, patch
s = b"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" * 50
d = b"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" * 50 + b"2"
src = BytesIO(s)
dst = BytesIO(d)
magic, block_len, strong_len = get_signature_args(len(s))
sig = BytesIO()
signature(dst, sig, strong_len, magic, block_len) # sig由dst产生
dst.seek(0, 0)
sig.seek(0, 0)
_delta = BytesIO()
delta(src, sig, _delta) # src和sig对比产生delta
src.seek(0, 0)
_delta.seek(0, 0)
out = BytesIO()
patch(dst, _delta, out)
assert out.getvalue() == src.getvalue()
Public functions
from typing import IO
class LibrsyncError(Exception):
code: Any
def __init__(self, result) -> None: ...
RS_JOB_BLOCKSIZE: int
RS_DELTA_MAGIC: int
RS_MD4_SIG_MAGIC: int
RS_BLAKE2_SIG_MAGIC: int
RS_RK_MD4_SIG_MAGIC: int
RS_RK_BLAKE2_SIG_MAGIC: int
def get_signature_args(old_fsize: int, magic: int = 0, block_len: int = 0, strong_len: int = 0) -> tuple: ...
def signature(input:IO, output:IO, strong_len: int, sig_magic: int, block_size: int = ...) -> None: ...
def delta(input:IO, sigfile:IO, output) -> None: ...
def patch(input:IO, delta:IO, output) -> None: ...
Compile
python -m pip install setuptools wheel cython cffi
git clone https://github.com/synodriver/pyrsync
cd pyrsync
git submodule update --init --recursive
python setup.py bdist_wheel --use-cython --use-cffi
Backend Choose
Use RSYNC_USE_CFFI
env var to use cffi backend, otherwise it's depend on your python implementation.
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
python-rsync-0.1.0.tar.gz
(141.3 kB
view hashes)
Built Distributions
Close
Hashes for python_rsync-0.1.0-pp310-pypy310_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f63b9c2bb7d3853dd367c3b06f867da7d36b0b7bf869cf4979500ad428b020e |
|
MD5 | a93e88d59d5b164d8b94f57462624daf |
|
BLAKE2b-256 | bb37fecba747aa7d23fddc6830301e1b49d30c7d6c78cc544e585a7f011bbc30 |
Close
Hashes for python_rsync-0.1.0-pp310-pypy310_pp73-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7edee5b76dbb6c1100f8c346af869e9fe43799b7f81ab49a9563ecc8a424a86 |
|
MD5 | b87bbb89571b8899cdb1859f4e084662 |
|
BLAKE2b-256 | 9545107d5dc2ee40753140ef60e01886d825b302749a867154c2a3a351492b99 |
Close
Hashes for python_rsync-0.1.0-pp310-pypy310_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 887d71a64102ae83545c224b7f7b767f2fa670e95ad08d022294b538d47d6f9c |
|
MD5 | 7476d1a37961fa7a071d5dd8de158f5d |
|
BLAKE2b-256 | 9b119568711b51cf1f2b557b92093a729fadcdf8ec03730000608f3e7fd707a9 |
Close
Hashes for python_rsync-0.1.0-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e50ba2a259862da5cdb6c46d769ab553244f3b149c8724d4799ad54d9cb95cc0 |
|
MD5 | 9c55f01eaabd7ebdf276de53dbbecc77 |
|
BLAKE2b-256 | 0098edbbdd29ef236cc7783b39fc44e892fc921ff2355e3636573e2fe4023e4c |
Close
Hashes for python_rsync-0.1.0-pp39-pypy39_pp73-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67d62af238b7fc60a8f5b60cab9f4b78d9d07bfc8cc65ba3a6f921de50c5e3ab |
|
MD5 | 851f926f27414f1a06286ef56dd8446c |
|
BLAKE2b-256 | 5571618d78240a80bdda0c0b8064668a3f84e68451540f5b1bbbc53eb31fc64c |
Close
Hashes for python_rsync-0.1.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6344e5bbc6cc90618d20ad41783ee93142078c148fc16fb57d8e94e587787b24 |
|
MD5 | e78132372e7c42a2dbf831231b0b85d3 |
|
BLAKE2b-256 | 68e7ebd5575e10511258f238483981da6dd5114680c7b44fe814420b510298b9 |
Close
Hashes for python_rsync-0.1.0-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 908e2343c511c3afc1bf4a5c6a8a65aeae57e7c9ec08cbc57f160941acb6aa4b |
|
MD5 | 7cd7a2b8bde3250c78cdcc3f8b1912ad |
|
BLAKE2b-256 | 86275beb0ca867ae4f0c7bc79d0a26ee5f35e64e0a7d79ed6872d17409a97733 |
Close
Hashes for python_rsync-0.1.0-pp38-pypy38_pp73-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7453ede37446c821b659d6c8231b74a54e7b9683c0073d05e9cf0c6d7b40e9c0 |
|
MD5 | 0f448ebe2de612c30e8c08bf0a2a53b7 |
|
BLAKE2b-256 | 419521c008c0715feeb945920d48a9323cdb9fdf0e823a5027a148266d6d1bef |
Close
Hashes for python_rsync-0.1.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6036fc07cc7a01f94e0b6e3a365737d317401db1db0849d749eb9a39bbc20c93 |
|
MD5 | 74ddac3da3c1ad4439d94de8e8b2d782 |
|
BLAKE2b-256 | 59f21cef1313e5b0e447788fedff3ba6d064947f7ec5f2945278cbb3e5bcf48c |
Close
Hashes for python_rsync-0.1.0-pp37-pypy37_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c69a4999e0ca68ed6821144d60b203593f8ed2adfa6dba3fc6397215a3d74b8b |
|
MD5 | e8fac9be5d493d6688a98be4ce00a2f1 |
|
BLAKE2b-256 | 10b7b5ea32daeef46ef7bb1aa29ac36c13342a9e3161ac289b766a05383cf1e3 |
Close
Hashes for python_rsync-0.1.0-pp37-pypy37_pp73-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1b4ec2a29b17facb25057767c2728c1ddc0f251258acc5653e6084e52b6233b |
|
MD5 | 52f8e4ad883b92529fd5cc938ccfd941 |
|
BLAKE2b-256 | 612b695b128c56c5fd74cf63138f9af52ff38a448fb1a4f390e239d52b6ef6bd |
Close
Hashes for python_rsync-0.1.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbfb9f61137da6a75436a107fc0b51daec9f4a148b95c3f7442449b42f744ffc |
|
MD5 | 134346949bc600fdc2238724be6bc8c1 |
|
BLAKE2b-256 | 93a3fcc13e5089ea7f9a020f40833f8980aad51cd422f078282e03915e8126af |
Close
Hashes for python_rsync-0.1.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a00d382807eb4edec550331f14445b9a443db2a735e832212b54ef0a184a661 |
|
MD5 | fd8ef45965fcfe7ff0b71a9961dccb29 |
|
BLAKE2b-256 | 0b4f3e32ccd36db271199e82fc9381759147f43b1379eb7cf8b64e4522682b8e |
Close
Hashes for python_rsync-0.1.0-cp312-cp312-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a12e598b7090f5f56fc1af9d7b4667ef472c69e1535c24b045e61f805623369d |
|
MD5 | c19c7fcc94cf38d1f23055bbdd0392a1 |
|
BLAKE2b-256 | a22e850e5d0e3e26321f985cf98b7a28e2498eeaef7838c61b3dc49355477669 |
Close
Hashes for python_rsync-0.1.0-cp312-cp312-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c39af4b8d2e19011362d865333e8dda17fa4b258f105b19431e4ccd62e7bd57 |
|
MD5 | b2be59d1f7cfb1a0ed465b011c022b90 |
|
BLAKE2b-256 | 96c031fe81900f8423d740ad2114c5a89f2ab24da24f43c17b10f841654c2fa0 |
Close
Hashes for python_rsync-0.1.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a66efefd8add9c032e6f71a6ef37b01a7cb32aa8f28b2ba641b536363f25e139 |
|
MD5 | 3ac4a15ff2d0a1b315ba16219d7ccfd8 |
|
BLAKE2b-256 | c4c0d8574334065133f94b3dcb2b15c4970a3e1f6cf4e5fa5f45682ae06409ef |
Close
Hashes for python_rsync-0.1.0-cp311-cp311-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d5ce9a9a280ddd5dc6174b128cc1a6393c885c16cf3da42c5214b27554aeea4 |
|
MD5 | c5e6b423c29997118413285bed280a06 |
|
BLAKE2b-256 | 6d654b167fd9275b256c029a8f90930ea2c1c3790f370bcbc561089e590d4903 |
Close
Hashes for python_rsync-0.1.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5123e2073f729d04a4431b6dd393b76b4d4e139e4ae093d922511a150076284 |
|
MD5 | 2a3ee8e772bc919bd48da545704e22e2 |
|
BLAKE2b-256 | 64c54a85641a7773203800a4938e1018095cd9ada0e44e71a3c88c97ac2ed4e7 |
Close
Hashes for python_rsync-0.1.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 720b41cfe313bf74a5127446716b64b52ee09a1234f1cef06b6e362e942bd6d1 |
|
MD5 | 3f71d1720986a025f96e571995762ad3 |
|
BLAKE2b-256 | a571c2cc6895605a04e606bf642e0b8702a46dde5ef6cc0c2f241e26e55ae14e |
Close
Hashes for python_rsync-0.1.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f48ed5736e641d46a0b366e2cb5b36c66488b8f90e92b7c452f08c83e3b9e390 |
|
MD5 | 0e120fcc2d462afd68f51f5e15fb16a6 |
|
BLAKE2b-256 | 266d012263c6291d23603d8f6eb12e93f275849f6a30e528f8e1d1a0e60d1a01 |
Close
Hashes for python_rsync-0.1.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a2650cf9ae4bfdbc03ec53508ae76585d6efc9c9311879933ff913c81db9b0b |
|
MD5 | 53ebeecf67b3004001da06d17b20302c |
|
BLAKE2b-256 | 32e7231c89458e2b15e878ed49d1c42347fc6fc4844cd12b7b22916ec6805cc7 |
Close
Hashes for python_rsync-0.1.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84798b90bbe3d1238d6dc6b5ffca87be42af447862b27aa109f96e8ec34e34fc |
|
MD5 | 4acb6ebd2821ada52fd4fa049d64b1a1 |
|
BLAKE2b-256 | e2a0386e7b25fe6fcba3d0ff432b5df05192cae106af65ad8bd7fc56e8bd5ebd |
Close
Hashes for python_rsync-0.1.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cfde68f5ecffcda1314b25ed5e5f81c67ce7da82d0bea1e7b43c11ca02bbb84 |
|
MD5 | fe4a4707a6f33ec6f10e01af9028deb6 |
|
BLAKE2b-256 | 809cacbf7bd08e0e9b832b5a0e5dad1f422d2169c502d67a219fb1c3565669f1 |
Close
Hashes for python_rsync-0.1.0-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae4990d98089c04481dfa5a99e62d353a222d39d53e2fd03cc3eba42ab201859 |
|
MD5 | 43907eca12740f8c0a105e4aec20a8dc |
|
BLAKE2b-256 | e846a199c4a280d139103a1e5eddbc71f178187034b66fd5428f4718e5e5d02f |
Close
Hashes for python_rsync-0.1.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a1db001571a4ab293c8b6e75be126d7693f3289b39a2a5f27f3e47db9fdafcf |
|
MD5 | 459fa540bf60435e18e2827f9eee9be4 |
|
BLAKE2b-256 | 90093530c5337d4c5cbcf5c8b41e20c83ed19fbfca3b906dfb190b0d742e8320 |
Close
Hashes for python_rsync-0.1.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5ad2fb61e33e4a7ae777d876b3c13b14f182fef2d5918639ee44a87714a365b |
|
MD5 | 6d5d20770796e389508c6ee0b55deb81 |
|
BLAKE2b-256 | 6b771f87969ada29f9cc35ffbad1af9d9807b5425cc60e5bbd73d563ed8dfa66 |
Close
Hashes for python_rsync-0.1.0-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9222631c91a3e770fcc7f2dc2aba8808bfb1f844a85058e42e604e700b9581d0 |
|
MD5 | c3fed28ce33411cbbbd3e499d1bf3e0f |
|
BLAKE2b-256 | e10ce6b534f50a1e8ac545eb0d920753e2b5d70c9ca69ed9d76c14e80ddf9ef3 |
Close
Hashes for python_rsync-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae08424cf072af664004846e89431a0eba186756b17d8a64d17b564f11ffa50b |
|
MD5 | 5d4317a115f31f2bb3455496d2544fa6 |
|
BLAKE2b-256 | 2cc6a4f2a810a066dcac663c843c4f1b4f45594e1986292dcb1c97b08c98bc91 |
Close
Hashes for python_rsync-0.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 629fcb5df29dfd63dc04e79fc6db78eadf0f7f65619864ef64e24706a39e9248 |
|
MD5 | a41f1aeeb650dca38cc6d42edb704bb8 |
|
BLAKE2b-256 | ee3b3b4baed922a3043d82eb3eb95942376620cb6bfc115ec36b358b97092cb8 |
Close
Hashes for python_rsync-0.1.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f4bf001c2655004419ba0f4199ab0f66ca02bc784fd0325b0551661013caf3d |
|
MD5 | eb3780e8ff2321efd213642d0551cbd7 |
|
BLAKE2b-256 | ef1180b86d50f725212290de53655433b484cf476351085cf1c7a940cf9396a5 |
Close
Hashes for python_rsync-0.1.0-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e0a6d77bbdae238f6296fc462d3ad0e8c4f65c2362ec37b4e012fcc2c9f3570 |
|
MD5 | 7c1162917afa05de266ee62819c738bb |
|
BLAKE2b-256 | eadb0c42ea7dda1bb937ef55ad5491b214efa900c30e0a233746c88356daba7a |
Close
Hashes for python_rsync-0.1.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6143f697df473eb80e78379944335ed0f494caafa085ec124b843f71804a9e37 |
|
MD5 | 4f08df006784a157c579c4bd30b02c8d |
|
BLAKE2b-256 | 88157805f12abdae7697d6170000c1a6f7a8a81c2353cefe3508f9db779e05e2 |