Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

Update notifications for your python app

Project description

Send a notification when there is an update available for your package! Py-port of update-notifier.

Install

pipenv install update_notipy

or

pip install update_notipy

Usage

from update_notipy import update_notify

update_notify(
    <pkg_name>,
    <pkg_version>,
    callback=<callback>,
    message=<message>,
    defer=<True|False>).notify()

Arguments

  • pkg_name: str: name of the package as registered on PyPI
  • pkg_version: str: version of the installed package, to be compared with the latest one
  • callback: Callable: function to be called instead of printing the standard message
  • message: str: custom message to be printed
  • defer: bool: set to True if you want to notify the user when the app closes

Examples

from update_notipy import update_notify

__version__ = "0.1.0"

update_notify('pkg-info', __version__).notify()

#    ┌───────────────────────────────────────────┐
#    │                                           │
#    │   Update available 0.1.0 → 0.1.2          │
#    │   Run pip install -U pkg-info to update   │
#    │                                           │
#    └───────────────────────────────────────────┘

def foo():
    four = 2 + 2
    print(four)

update_notify('pkg-info', __version__, callback=foo).notify()

# 4

update_notify('pkg-info', __version__, message="Hello, world!").notify()

# Hello, world!

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
update_notipy-0.1.2-py2-none-any.whl (4.2 kB) Copy SHA256 hash SHA256 Wheel py2 Apr 14, 2018
update_notipy-0.1.2-py3.6.egg (2.5 kB) Copy SHA256 hash SHA256 Egg 3.6 Apr 14, 2018
update_notipy-0.1.2-py3-none-any.whl (4.2 kB) Copy SHA256 hash SHA256 Wheel py3 Apr 14, 2018
update-notipy-0.1.2.tar.gz (2.5 kB) Copy SHA256 hash SHA256 Source None Apr 14, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page