Skip to main content

A library for Python developers that prompts your users to upgrade when a new version of your package is released

Project description

Logo

PyPI version Documentation Status Build and Test Codecov Language grade: Python Downloads MIT license

check4updates is a Python package designed for developers to provide a reliable, simple, and unobtrusive way to check whether their users have the most recent release of their package installed and prompt users when an update is available.

It is recommended that check4updates be placed in your package’s __init__.py file so that it is called every time the package is used. To minimise runtime, check4updates only checks online if certain conditions are met, such as sufficient time since the last check. This ensures that incorporating check4updates into your Python package will have a negligible (<0.01sec) effect on the time it takes users to import something from your package (which is when __init__.py is called) and no impact on any of the functions within your package.

When check4updates does check online, it searches PyPI for the most recent release (based on version number) and compares that value with the version installed on the user’s system. If certain conditions are met, the user is then prompted to install the updated version which must be done by the user in a separate command so as not to interrupt the currently executing script. Users can choose to upgrade now, skip this version, be reminded later, or never be asked again and check4updates will remember this choice and act accordingly.

Documentation

Detailed documentation and examples are available at readthedocs.

Design principles

  • periodically check for updates without user action and without slowing down the parent script
  • only prompt the user when necessary
  • give the user the option to update now, be reminded later, skip this version, or never be asked again
  • handle all errors silently to prevent the parent script from being impacted

Usage

To use check4updates, place the following lines in your package's __init__.py file:

from check4updates import check_and_prompt
check_and_prompt("your_package")

It is as simple as that and check4updates will do the rest!

Contact

If you find any errors, have any suggestions, or would like to request that something be added, please email alpha.reliability@gmail.com.

If you would like to receive an email notification when a new release of check4updates is uploaded to PyPI, NewReleases.io provides this service for free.

Project details


Download files

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

Source Distribution

check4updates-0.0.2.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

check4updates-0.0.2-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file check4updates-0.0.2.tar.gz.

File metadata

  • Download URL: check4updates-0.0.2.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for check4updates-0.0.2.tar.gz
Algorithm Hash digest
SHA256 46097c275850af58abb8b906549a79f1e8520d5f20e07f1ff4b93bebbfc9ad9c
MD5 62625d9e567300dc7c62beb6ce7502ca
BLAKE2b-256 4f090d8ece40fd813c5f933a2d90a86f12bbaedc159037300855ba89399621b9

See more details on using hashes here.

File details

Details for the file check4updates-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: check4updates-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for check4updates-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ee42c8f3027620f23a003f08061b1aa51ddf31cc3d85dc800a338f9766eb129
MD5 36a7d8ec5a97088fd8613ef3bf31ec43
BLAKE2b-256 aeeb7941bbcee49e5750628c5acb7e26035a3b1de9ce6807d3b12a47ea1f0866

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page