Skip to main content

GNTP

This is a Python library for working with the Growl Notification Transport Protocol

It should work as a dropin replacement for the older Python bindings

Installation

You can install with pip

$ pip install gntp

then test the module

$ python -m gntp.notifier

Simple Usage

import gntp.notifier

# Simple "fire and forget" notification
gntp.notifier.mini("Here's a quick message")

# More complete example
growl = gntp.notifier.GrowlNotifier(
    applicationName = "My Application Name",
    notifications = ["New Updates","New Messages"],
    defaultNotifications = ["New Messages"],
    # hostname = "computer.example.com", # Defaults to localhost
    # password = "abc123" # Defaults to a blank password
)
growl.register()

# Send one message
growl.notify(
    noteType = "New Messages",
    title = "You have a new message",
    description = "A longer message description",
    icon = "http://example.com/icon.png",
    sticky = False,
    priority = 1,
)

# Try to send a different type of message
# This one may fail since it is not in our list
# of defaultNotifications
growl.notify(
    noteType = "New Updates",
    title = "There is a new update to download",
    description = "A longer message description",
    icon = "http://example.com/icon.png",
    sticky = False,
    priority = -1,
)

URL based images do not work in the OSX version of growl 1.4 You can send the image along with the notification to get around this.

image = open('/path/to/image.png', 'rb').read()
growl.notify(
    noteType = "New Messages",
    title = "You have a new message",
    description = "This time we embed the image",
    icon = image,
)

Bugs

GitHub issue tracker

Changelog

v1.0.1
  • Fix bug with binary data (images) being encoded incorrectly

v1.0
  • Python 3.3 Support

v0.9
  • Remove duplicate code from gntp.config

  • Catch all errors and rethrow them as gntp.errors to make it easier for other programs to deal with errors from the gntp library.

  • Ensure that we open resource files as “rb” and update the documentation

v0.8
  • Fix a bug where resource sections were missing a CRLF

  • Fix a bug where the cli client was using config values over options

  • Add support for coalescing

v0.7
  • Support for images

  • Better test coverage support

0.6
  • ConfigParser aware GrowlNotifier that reads settings from ~/.gntp

Release files for gntp 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gntp 1.0.1
File Size Uploaded
gntp-1.0.1.tar.gz 10.9 kB Details

Release files / gntp-1.0.1.tar.gz

Download URL gntp-1.0.1.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bad7a9a3d877e46dc13ad60cacca0442901ed9ebd96708cebe9b8f280652e382
BLAKE2b-256 checksum
How to use checksums
de13fd85229d9fbddae4e2e44cdb7ae61f737239b4fe2181b97f9a04a46ac61c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.0.3

3 release files

1.0.2

2 release files

This release

1.0.1 This release

1 release file

1.0

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5.1

1 release file

0.5

1 release file

0.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page