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.1

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.1
File Size Uploaded Provenance Actions
pyupdator-0.1.1.tar.gz 123.8 kB Without provenance Details for pyupdator-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 270.5 kB

Release files / pyupdator-0.1.1.tar.gz

Download URL pyupdator-0.1.1.tar.gz
Size 123.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5ca55008cc69125e249aac244a91612fbd3797f9022bdfe74720e408711bd0c0
BLAKE2b-256 checksum
How to use checksums
5150c9e8014d6cbaca9a101b693df075071b3daad75e07d73a153af957a4d923
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.1-py3-none-any.whl

Download URL pyupdator-0.1.1-py3-none-any.whl
Size 146.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83cd756691547611744de30a359ab656e20123daf947bfc896836e088fd8b981
BLAKE2b-256 checksum
How to use checksums
4855782d8da6df28658b296d9d965bf9b03840d5c4538c9e12bb8824aa078527
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.1

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.1 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