Skip to main content

Lightweight dependency free update software

Project description


rupdater is a super lightweight and dependency-free updater, that provide remote version parsing, downloading and getting hash sum of an update.


rupdater can be install from PyPi by running:

pip install rupdater


First of all, create new instance of Updater. It takes 2 arguments: current local version and URL of the remote version data file:

from rupdater import Updater
updater = Updater('1.0.0a0', '', use_json=True)

Now you can check for an update by calling the check() method:

if updater.check():
    print('Update found!')

After checking, you may want to download the update. This can be done with download() method, that returns a file-like object (byte-mode) of the downloaded update (it stores in a temp file). You should use it only with context manager.

with as update_file, open('', 'w+b') as f:

This example will read the data from update_file and write it to the

More complicated example with chunk-by-chunk reading/writing:

with as update_file, open('', 'w+b') as f:
    [f.write(chunk) for chunk in iter(lambda: * 16), b'')]

rupdater also has hash static method, that takes 2 required arguments and 1 optional: file-like object, hashing algorithm (as string) and chunk size, which is 1024 * 16 by default. This is the example of usage:

with as update_file:
    hashes_match = Updater.hash_file(update_file, 'sha256') == updater.hash

Warning! If you want to reuse the update file, you have to seek(0). Example:

with as update_file, open('', 'w+b') as f:
    hashes_match = Updater.hash_file(update_file, 'sha256') == updater.hash
    if hashes_match:
        [f.write(chunk) for chunk in iter(lambda: * 16), b'')]

You can also parse version data again manually by calling get_version_data().

Portability is absolutely independent of anything at the moment. Python Standard Library is the only requirement. So if you need, you can just copy this file and use it like a single module.

Exceptions handling

rupdater does not catch any errors, you have to do it yourself as prefer. In addition, rupdater may raise ValueError when incorrect input data was given (version data file does not formatted properly, unknown hashing algorithm, etc).

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rupdater, version 1.1.1a0
Filename, size File type Python version Upload date Hashes
Filename, size rupdater-1.1.1a0.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page