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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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