Python Package Update Checker
update-checker is a Python module (current version 0.18.0, last updated August 2020) that programmatically checks for updates to Python packages. It provides a simple API to determine if a newer version of a specified package is available. The library's release cadence appears to be infrequent, with the last update several years ago.
Warnings
- breaking The library explicitly states: 'Only whitelisted packages can be checked for updates. Contact update_checker's author for information on adding a package to the whitelist.' This means it may not work for arbitrary packages you wish to check unless they are on the author's whitelist.
- gotcha This library only *checks* for updates; it does not *perform* the update itself. Users are responsible for implementing the logic to download and install newer package versions.
- gotcha The library has not been updated since August 2020. While it may still function, there's a risk it might not be compatible with newer Python versions or changes in PyPI's API, or may contain unpatched vulnerabilities.
Install
-
pip install update-checker
Imports
- UpdateChecker
from update_checker import UpdateChecker
Quickstart
from update_checker import UpdateChecker
checker = UpdateChecker()
# Replace 'your_package_name' and '0.0.1' with actual package details
# For example, to check for updates to 'praw' with current version '0.0.1'
result = checker.check('praw', '0.0.1')
if result:
# result is None when an update was not found or a failure occurred
# result is an UpdateResult object with attributes like:
# available_version, package_name, running_version, release_date
print(f"An update is available for {result.package_name}!")
print(f"Current version: {result.running_version}, Available version: {result.available_version}")
if result.release_date:
print(f"Release date of new version: {result.release_date}")
else:
print("No update found or an error occurred.")