Skip to main content

A Python module written in Rust that implements the zsync algorithm

Project description

pyzsync

A Python module written in Rust that implements the zsync algorithm.

Usage

Use the Python module as a script

# Show help.
python -m pyzsync --help

# Create a zsync file.
poetry run python -m pyzsync zsyncmake bigfile

# Compare two files and show how much data from the first file
# can be used to create the second file using the zsync algorithm.
python -m pyzsync compare bigfile1 bigfile2

# Download a file using zsync.
# This will automatically use blocks from the local files
# noble-desktop-amd64.iso and noble-desktop-amd64.iso.zsync-tmp-*
# if available.
python -m pyzsync zsync https://cdimage.ubuntu.com/daily-live/current/noble-desktop-amd64.iso.zsync

Use the Python module in a script

from pyzsync import create_zsync_file

create_zsync_file("bigfile", "bigfile.zsync")

See tests/test_pyzsync.py and pyzsync/__main__.py for more examples.

Build / Development

Based on PyO3

# Install toolchain (linux)
rustup toolchain install beta-x86_64-unknown-linux-gnu

# Build package in debug mode and install it to virtualenv
poetry install
poetry run maturin develop --release

# Run clippy
cargo clippy

# Run cargo test
cargo test --no-default-features

# Run pytest
poetry run pytest -vv

# Build release package
poetry run maturin build --release

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

pyzsync-1.2.6.tar.gz (1.9 MB view hashes)

Uploaded Source

Built Distributions

pyzsync-1.2.6-cp312-none-win_amd64.whl (270.9 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

pyzsync-1.2.6-cp312-cp312-manylinux_2_34_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.34+ x86-64

pyzsync-1.2.6-cp312-cp312-macosx_10_12_x86_64.whl (400.4 kB view hashes)

Uploaded CPython 3.12 macOS 10.12+ x86-64

pyzsync-1.2.6-cp311-none-win_amd64.whl (270.9 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

pyzsync-1.2.6-cp311-cp311-manylinux_2_34_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.34+ x86-64

pyzsync-1.2.6-cp311-cp311-macosx_10_12_x86_64.whl (400.1 kB view hashes)

Uploaded CPython 3.11 macOS 10.12+ x86-64

pyzsync-1.2.6-cp310-none-win_amd64.whl (270.9 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pyzsync-1.2.6-cp310-cp310-manylinux_2_34_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.34+ x86-64

pyzsync-1.2.6-cp310-cp310-macosx_10_12_x86_64.whl (400.1 kB view hashes)

Uploaded CPython 3.10 macOS 10.12+ x86-64

pyzsync-1.2.6-cp39-none-win_amd64.whl (271.0 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pyzsync-1.2.6-cp39-cp39-manylinux_2_34_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.34+ x86-64

pyzsync-1.2.6-cp39-cp39-macosx_10_12_x86_64.whl (400.3 kB view hashes)

Uploaded CPython 3.9 macOS 10.12+ x86-64

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