Skip to main content

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.

Source Distribution

update-notipy-0.1.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distributions

update_notipy-0.1.1-py3.6.egg (2.4 kB view details)

Uploaded Egg

update_notipy-0.1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file update-notipy-0.1.1.tar.gz.

File metadata

  • Download URL: update-notipy-0.1.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for update-notipy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5f55937ae46a32d5eb0c2d2f60ad00b82f11c4fdbc520552b43a719fc9093f42
MD5 485e1a3d7c652b7c2d483b2a0c58c0d9
BLAKE2b-256 fc52682a6ac9571b839183bedc3069243aef81b8ffd3e7ff2b0b77a3c861d0f1

See more details on using hashes here.

File details

Details for the file update_notipy-0.1.1-py3.6.egg.

File metadata

File hashes

Hashes for update_notipy-0.1.1-py3.6.egg
Algorithm Hash digest
SHA256 6825a1045b242b990a76bc0c45b184f403df28e2bb07cb95d4f90e7970bf530d
MD5 99a36cd94fd5db84212c65dd5f2e41a1
BLAKE2b-256 cde09bcb260740974ee7263573e16458a0be741a38cd95a23b69eb8c1925770d

See more details on using hashes here.

File details

Details for the file update_notipy-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for update_notipy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84a2ddf75bbb441066676872a9d936a2be43f06c2e7294d96ce0737ed985ce0c
MD5 a5eb41b0b25673237898c99a0e61e155
BLAKE2b-256 eb6dd1162dd7559433f27591cf555c0d85965144f665afab2474400abd217a8d

See more details on using hashes here.

Supported by

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