Eclectic Media Git pynotify / cdf0986
Added a readme with full usage and installation documentation Ariana Giroux 2 months ago
1 changed file(s) with 50 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 About This Software
1 ===================
2
3 This package provides an ease of use wrapper for python around ``GNU`` and ``libnotify-send`` compatible interfaces.
4
5 In layman's terms, it allows easier scripting of notifications on Ubuntu/Ubuntu Budgie desktop native toast notifications.
6
7 Installation
8 ============
9
10 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: ::
11
12 -e git://eclecticmedia.space/public/pynotify#egg=pynotify
13
14 *Note: This line can be interpreted alongside your other pypi_ packages.*
15
16 Installation from Source
17 ------------------------
18
19 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``.
20
21 Usage
22 =====
23
24 Python API
25 ----------
26
27 To use the python API first import the Notifier object from the package and initialize it with optional data: ::
28
29 >>> from pynotify import Notifier
30 >>> notifier = Notifier(title='Eclectic Media Notifier', # optionally set object title for logs and display
31 >>> icon_path='~/notifier_icon.png`, # optionally set an icon path
32 >>> timeout=100) # time before notification naturally leaves screen
33 >>>
34 >>> notifier('my glorious notification!') # Notification spawns asynchronously
35
36 Command Line Interface
37 ----------------------
38
39 The package additionally provides a simple `Click CLI`_ endpoint which allows execution from the command line. Its usage is simple: ::
40
41 $ notify_once "a simple message" # spawns notification with provided message, with default timeout.
42
43 Contribution
44 ============
45
46 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``
47
48 .. _pypi: https://pypi.org/
49 .. _`Click CLI`: https://click.palletsprojects.com/en/7.x/