{"id":16217238,"url":"https://github.com/synodriver/pyrsync","last_synced_at":"2025-03-19T10:30:44.979Z","repository":{"id":46067458,"uuid":"514622762","full_name":"synodriver/pyrsync","owner":"synodriver","description":"python binding to librsync","archived":false,"fork":false,"pushed_at":"2024-03-27T11:50:13.000Z","size":507,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-11T11:26:09.051Z","etag":null,"topics":["cffi","cpython","cython","librsync","pypy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/synodriver.png","metadata":{"files":{"readme":"README.markdown","changelog":"changename.py","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-07-16T15:58:36.000Z","updated_at":"2023-05-22T13:39:17.000Z","dependencies_parsed_at":"2024-03-27T12:29:39.171Z","dependency_job_id":null,"html_url":"https://github.com/synodriver/pyrsync","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.05555555555555558,"last_synced_commit":"e06c7d20bceee539567daae24c3dc14d1db1a10b"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Fpyrsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Fpyrsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Fpyrsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Fpyrsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synodriver","download_url":"https://codeload.github.com/synodriver/pyrsync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982182,"owners_count":20378605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cffi","cpython","cython","librsync","pypy"],"created_at":"2024-10-10T11:26:14.278Z","updated_at":"2025-03-19T10:30:44.645Z","avatar_url":"https://github.com/synodriver.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003ci\u003e✨ pyrsync ✨ \u003c/i\u003e\u003c/h1\u003e\n\n\u003ch3 align=\"center\"\u003eThe python binding for \u003ca href=\"https://github.com/librsync/librsync\"\u003elibrsync\u003c/a\u003e \u003c/h3\u003e\n\n[![pypi](https://img.shields.io/pypi/v/python-rsync.svg)](https://pypi.org/project/python-rsync/)\n![python](https://img.shields.io/pypi/pyversions/python-rsync)\n![implementation](https://img.shields.io/pypi/implementation/python-rsync)\n![wheel](https://img.shields.io/pypi/wheel/python-rsync)\n![license](https://img.shields.io/github/license/synodriver/pyrsync.svg)\n![action](https://img.shields.io/github/workflow/status/synodriver/pyrsync/build%20wheel)\n\n## Install\n```bash\npip install python-rsync\n```\n\n\n## Usage\n```python\nfrom io import BytesIO\nfrom pyrsync import delta, get_signature_args, signature, patch\n\ns = b\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" * 50\nd = b\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" * 50 + b\"2\"\nsrc = BytesIO(s)\ndst = BytesIO(d)\nmagic, block_len, strong_len = get_signature_args(len(s))\nsig = BytesIO()\nsignature(dst, sig, strong_len, magic, block_len)  # sig由dst产生\ndst.seek(0, 0)\nsig.seek(0, 0)\n_delta = BytesIO()\ndelta(src, sig, _delta)  # src和sig对比产生delta\nsrc.seek(0, 0)\n_delta.seek(0, 0)\nout = BytesIO()\npatch(dst, _delta, out)\nassert out.getvalue() ==  src.getvalue()\n```\n\n## Public functions\n```python\nfrom typing import IO\n\nclass LibrsyncError(Exception):\n    code: Any\n    def __init__(self, result) -\u003e None: ...\n\nRS_JOB_BLOCKSIZE: int\nRS_DELTA_MAGIC: int\nRS_MD4_SIG_MAGIC: int\nRS_BLAKE2_SIG_MAGIC: int\nRS_RK_MD4_SIG_MAGIC: int\nRS_RK_BLAKE2_SIG_MAGIC: int\n\ndef get_signature_args(old_fsize: int, magic: int = 0, block_len: int = 0, strong_len: int = 0) -\u003e tuple: ...\ndef signature(input:IO, output:IO, strong_len: int, sig_magic: int, block_size: int = ...) -\u003e None: ...\ndef delta(input:IO, sigfile:IO, output) -\u003e None: ...\ndef patch(input:IO, delta:IO, output) -\u003e None: ...\n```\n\n\n### Compile\n```\npython -m pip install setuptools wheel cython cffi\ngit clone https://github.com/synodriver/pyrsync\ncd pyrsync\ngit submodule update --init --recursive\npython setup.py bdist_wheel --use-cython --use-cffi\n```\n\n### Backend Choose\nUse ```RSYNC_USE_CFFI``` env var to use cffi backend, otherwise it's depend on your python implementation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynodriver%2Fpyrsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynodriver%2Fpyrsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynodriver%2Fpyrsync/lists"}