https://github.com/openmined/py_fast_rsync
https://github.com/openmined/py_fast_rsync
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/openmined/py_fast_rsync
- Owner: OpenMined
- Created: 2024-10-07T12:08:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-02T13:24:04.000Z (9 months ago)
- Last Synced: 2025-06-25T06:47:35.098Z (7 months ago)
- Language: Python
- Size: 17.6 KB
- Stars: 1
- Watchers: 8
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# py_fast_rsync
```py_fast_rsync``` is a Python library implemented in Rust using the ```pyo3``` and ```fast_rsync``` crates. This library provides functions for calculating the difference between two data sets and applying those differences to create updated data sets, as well as a simple function to sum two numbers and return the result as a string.
### Usage
Here's how you can use the functions provided by ```py_fast_rsync```:
```python
import py_fast_rsync
from py_fast_rsync import signature
# 1. take data_a and return a "signature" of that data
# which is much smaller than the original data.
data_a = b"hello world"
sig = signature.calculate(data_a)
# 2. take the signature for data_a and data_b
# and return a delta between data_a and data_b.
data_b = b"hello world!"
delta = py_fast_rsync.diff(sig, data_b)
# 3. apply the delta to data_a
# (usually) return data_b
probably_data_b = py_fast_rsync.apply(data_a, delta)
assert probably_data_b == data_b
```
## Building the Project
### Requirements for Development
- Rust
- Python
- ```maturin``` (for building, developing and publishing the package)
First, ensure you have ```maturin``` installed. You can install it via pip:
```sh
pip install maturin
```
To build the project, run:
```sh
maturin develop
```
This will compile the Rust code and install the resulting Python package in your current Python environment.