Eclectic Media Git pynotify / master
master

Tree @master (Download .tar.gz)

About This Software

This package provides an ease of use wrapper for python around GNU and libnotify-send compatible interfaces.

In layman's terms, it allows easier scripting of notifications on Ubuntu/Ubuntu Budgie desktop native toast notifications.

Installation

This package is designed to function as a fully fledged pypi package, installable with pip. Therefore, it is best used when included as a dependency in your projects. When writing a python project, include the following in your requirements.txt file:

-e git://eclecticmedia.space/public/pynotify#egg=pynotify

Note: This line can be interpreted alongside your other pypi_ packages.

Installation from Source

If you intend to install the package globally from source, simply clone the repository from git://eclecticmedia.space/public/pynotify, running python setup.py install on the included setup.py script. Once you have installed the package globally, you can import from the package whenever you need with from pynotify import notifier.

Usage

Python API

To use the python API first import the Notifier object from the package and initialize it with optional data:

>>> from pynotify import Notifier
>>> notifier = Notifier(title='Eclectic Media Notifier',  # optionally set object title for logs and display
>>>                     icon_path='~/notifier_icon.png`,  # optionally set an icon path
>>>                     timeout=100)                      # time before notification naturally leaves screen
>>>
>>> notifier('my glorious notification!')  # Notification spawns asynchronously

Command Line Interface

The package additionally provides a simple Click CLI endpoint which allows execution from the command line. Its usage is simple:

$ notify_once "a simple message"  # spawns notification with provided message, with default timeout.

Contribution

The project is currently seeking git patches for bug fixes. If you would like to submit a patch or bug report, please do so to ariana.giroux+pynotify@gmail.com