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
Release history Release notifications | RSS feed
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.2.tar.gz
(2.5 kB
view hashes)
Built Distributions
update_notipy-0.1.2-py3.6.egg
(2.5 kB
view hashes)
Close
Hashes for update_notipy-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a8353bc31b8397c32b81146d7baee7b6373a68c8ef5decc68fa77d9b3c575c2 |
|
MD5 | 3e0fb5aa84327239e8b7a34872aa1569 |
|
BLAKE2-256 | fc259a00746385737343f93e1350945c9d4e50cc52f9a266bfe0ef8966edd17f |
Close
Hashes for update_notipy-0.1.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83ce193e800fbb644641e915b36dd35cd7d7fda7484ea2ce71648d20a32df62c |
|
MD5 | 29705503b4bd9d688a73229dfd93a252 |
|
BLAKE2-256 | 43f8b846b2d51fdee80804f6cf1b91bcd43f3faa226c0daaac760150e2d84f98 |