Skip to main content

PyPI version Downloads PyPI license Maintenance GitHub issues

Update_Check is a Python module to implement in distributed programs. The functions as of now are checking for updates and updating a users Python file. It works by comparing the users Python file to the newest raw version of the file that's stored on a website like GitHub.

Usage

Checking if File is Up to Date


One feature of this module is checking if the users file is up to date with the latest version.

Syntax:

pathToProgram(str): path to local file to be compared

programURL(str): URL to raw file on github (https://raw.githubusercontent.com/username/repo/file)

isUpToDate(pathToProgram, programURL)

Heres an example of the isUpToDate() function:

from update_check import isUpToDate

if isUpToDate(__file__, "https://raw.githubusercontent.com/username/repo/myProgram.py") == False:
   doSomething()

This function will return True if the program is up to date with the web version and will return False if it's not. Note: __file__ can be replaced with a path to a separate file.

 

Updating a File


To update a file using this module, you will need to use the update() function.

Syntax:

update(pathToProgram, programURL)

Here's an example of the update() function:

from update_check import update

update(__file__, "https://raw.githubusercontent.com/username/repo/myProgram.py")

That block of code would grab the file from the URL and update the local file to that file. Note: __file__ can be replaced with a path to a separate file.

 

Updating a File if it's not up to date


If you want a combination of the previous 2 functions, where it will check if a file isn't up to date, and if so, then it will update the file, then you want to use the checkForUpdates() function.

Syntax:

checkForUpdates(pathToProgram, URL)

Here's an example of the checkForUpdates() function:

from update_check import checkForUpdates

checkForUpdates(__file__, "https://raw.githubusercontent.com/username/repo/myProgram.py")

The above block of code will test if the file specified, is not up to date, and if it isn't, it will update the file from the URL and return True. If it is up to date, then it will return False and do nothing. Note: __file__ can be replaced with a path to a separate file.

Release files for update-check 0.0.11

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

Source distribution (sdist)

Source distribution for update-check 0.0.11
File Size Uploaded
update_check-0.0.11.tar.gz 2.9 kB Details

Release files / update_check-0.0.11.tar.gz

Download URL update_check-0.0.11.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3e6901f98c338fdfd65d4426a3d57c80bb71dd5b40ea00984c449be9768a3cc9
BLAKE2b-256 checksum
How to use checksums
05aee136af470e3188c733ad4d979dba1aa9cf2808c6f5f24d0078f56bea39c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.0.11 This release

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

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