Skip to main content

A simple Python wrapper around the ``terminal-notifier` <https://github.com/alloy/terminal-notifier>`_ command-line tool (version 2.0.0), which allows you to send User Notifications to the Notification Center on Mac OS X 10.10, or higher.

Screenshot

Installation

pip install pync

or

pip install git+https://github.com/SeTeM/pync.git

or

git clone git://github.com/SeTeM/pync.git
cd pync
python setup.py install

Usage

For full information on all the options, see the tool’s README.

Examples:

Using the notify function

import pync

pync.notify('Hello World')
pync.notify('Hello World', title='Python')
pync.notify('Hello World', group=os.getpid())
pync.notify('Hello World', activate='com.apple.Safari')
pync.notify('Hello World', open='http://github.com/')
pync.notify('Hello World', execute='say "OMG"')

pync.remove_notifications(os.getpid())

pync.list_notifications(os.getpid())

Using the notifier object

from pync import Notifier

Notifier.notify('Hello World')
Notifier.notify('Hello World', title='Python')
Notifier.notify('Hello World', group=os.getpid())
Notifier.notify('Hello World', activate='com.apple.Safari')
Notifier.notify('Hello World', open='http://github.com/')
Notifier.notify('Hello World', execute='say "OMG"')

Notifier.remove(os.getpid())

Notifier.list(os.getpid())

License

All the works are available under the MIT license. Except for ‘Terminal.icns’, which is a copy of Apple’s Terminal.app icon and as such is copyright of Apple.

See LICENSE for details.

Download files

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

Source Distribution

pync-2.0.2.tar.gz (373.6 kB view details)

Uploaded Source

File details

Details for the file pync-2.0.2.tar.gz.

File metadata

  • Download URL: pync-2.0.2.tar.gz
  • Upload date:
  • Size: 373.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pync-2.0.2.tar.gz
Algorithm Hash digest
SHA256 91485ba7d157270b274535e8bec802d5ae6963f0bb0183e99510a3235206c419
MD5 ae622f2121c6a2b9facdf32e4b16beca
BLAKE2b-256 7d0b4f47b28803e95e52b5f8fa29d9ee4d4edd0983182851c8e6047da874eae6

See more details on using hashes here.

Supported by

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