Skip to main content

pyupdator

Delta updater for games (Torrent and HTTP Zip support).

pyupdator is an independent, pip-installable Python library that lets a game launcher (or any host application) update installed game files without downloading the entire new release. It supports:

  • BitTorrent piece-level delta (via libtorrent, optional) — download only the missing SHA-1 pieces of a .torrent.
  • HTTP ZIP delta — read a remote ZIP's Central Directory over HTTP Range requests and download only the changed files.
  • Content-Defined Chunking (CDC) via Gear/FastCDC hashing — download only the changed byte ranges of a single HTTP-hosted file.

The library core (pyupdator/) contains no tkinter, customtkinter, or GUI code. A separate optional package (pyupdator_gui/) provides a Tkinter/customtkinter launcher window and is installed with pip install pyupdator[gui].

Installation

# Library core only (no GUI)
pip install pyupdator

# Library + optional GUI
pip install pyupdator[gui]

Quick start

from pyupdator import Updater

updater = Updater(install_dir="C:/Oyun", source="oyun.torrent")
plan = updater.analyze()
print("Plan:", plan)

updater.update(progress_callback=my_progress_func)

# Optional verification
result = updater.verify()
print("Verified:", result)

See examples/basic_usage.py for a complete GUI-free example.

Project layout

pyupdator/            # library core (no GUI imports)
  __init__.py         # public API: Updater, UpdaterError, logging helpers
  core/
    __init__.py
    torrent.py        # .torrent parse, recheck, delta plan, apply, verify
    zip_engine.py     # HTTP ZIP delta + CDC chunker
    backend_manager.py# download backend detection & selection
  utils/
    __init__.py
    helpers.py        # UpdaterError, hashing, safe_join, config, ...
pyupdator_gui/        # optional Tkinter/customtkinter GUI
  __init__.py
  main_window.py      # MainWindow ported from gui.py
examples/
  basic_usage.py      # GUI-free usage example
tests/                # existing test suite moved here
pyproject.toml
README.md

Updater API contract

from pyupdator import Updater

updater = Updater(install_dir="C:/Oyun", source="oyun.torrent")
plan = updater.analyze()          # returns a plan dict
updater.update(progress_callback=my_func)   # applies the update
updater.verify()                  # verifies installed files against source

Logging

pyupdator uses the standard logging module (logger name "pyupdator"). The host launcher can forward logs to its own console or GUI:

import logging
from pyupdator import add_log_handler, set_log_level

handler = logging.StreamHandler()
add_log_handler(handler)
set_log_level(logging.DEBUG)

Backends

Backend Capability Notes
libtorrent PIECE_LEVEL Optional; true piece-level delta
aria2 FILE_LEVEL aria2c JSON-RPC
qBittorrent FILE_LEVEL Web API v2
uTorrent FILE_LEVEL Web UI, best effort
Transmission FILE_LEVEL RPC
manual FILE_LEVEL Manual/local source
http_zip CHUNK_LEVEL HTTP ZIP delta / CDC

libtorrent is often unavailable on Windows + Python 3.13; the library falls back to FILE_LEVEL backends and reports this clearly.

Tests

Run the test suite:

python -m pytest tests/

Individual test scripts can also be run directly:

python tests/test_cdc_delta.py
python tests/test_zip_delta.py

PyPI publishing

pip install build twine
python -m build
twine upload dist/*

If a PyPI token is required, set TWINE_USERNAME and TWINE_PASSWORD (or use ~/.pypirc). If twine upload returns 400 Bad Request because the name pyupdator collides with an existing package (e.g. pyupdater), rename the project in pyproject.toml and republish.

Metadata

Release files for pyupdator 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyupdator 0.1.0
File Size Uploaded Provenance Actions
pyupdator-0.1.0.tar.gz 123.7 kB Without provenance Details for pyupdator-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyupdator 0.1.0
File Interpreter ABI Platform Actions
pyupdator-0.1.0-py3-none-any.whl Python 3 none any Details for pyupdator-0.1.0-py3-none-any.whl

Total release size: 270.4 kB

Release files / pyupdator-0.1.0.tar.gz

Download URL pyupdator-0.1.0.tar.gz
Size 123.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b7dfac591c1ea0b11c1b429185af3c8867a63c3af1dcb7e798cb6549deff8299
BLAKE2b-256 checksum
How to use checksums
894020aec07b894d6b061802014b35d6ef8e80a5de7dc464566e7a9d11e39d4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / pyupdator-0.1.0-py3-none-any.whl

Download URL pyupdator-0.1.0-py3-none-any.whl
Size 146.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ff1cc4e5a4c8f5d0a681ac83fd581f42dc45bfdc9c975ebbfc4b388eb322583
BLAKE2b-256 checksum
How to use checksums
719790a3ddb4db1a883ad150c35c49cdb38fb717d8766d0fad802e51cb89c0e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Security for pyupdator 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page