Skip to main content

Growl Notification Transport Protocol for Python

Project description

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

# GNTP uses the standard Python logging
import logging
logging.basicConfig(level=logging.INFO)

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.3
  • Allow file:// scheme to be used for icons

v1.0.2
  • Fix bug with incoming password hash

  • Added info about license in each source file

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

Project details


Download files

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

Source Distribution

gntp-1.0.3.tar.gz (10.8 kB view details)

Uploaded Source

Built Distributions

gntp-1.0.3-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

gntp-1.0.3-py2-none-any.whl (15.7 kB view details)

Uploaded Python 2

File details

Details for the file gntp-1.0.3.tar.gz.

File metadata

  • Download URL: gntp-1.0.3.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gntp-1.0.3.tar.gz
Algorithm Hash digest
SHA256 f4a4f2009ecb8bb41a1aaddd5fb7c03087b2a14cac2c03af029ba04b9166dae0
MD5 a2c85eb3e3243255ac8f03af5d05b859
BLAKE2b-256 c46cfabf97b5260537065f32a85930eb62776e80ba8dcfed78d4247584fd9aa9

See more details on using hashes here.

File details

Details for the file gntp-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: gntp-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gntp-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9db9b1c3d9af0bc85043cefb32ed3876b093290698e4cf427321f6c72e0e9920
MD5 dd338cab3423b169087206b4885f2bd4
BLAKE2b-256 a734d94c3c9298d57dfcdbcd1f9412b9aa9818fdab53704dfc53d594df1c5830

See more details on using hashes here.

File details

Details for the file gntp-1.0.3-py2-none-any.whl.

File metadata

  • Download URL: gntp-1.0.3-py2-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gntp-1.0.3-py2-none-any.whl
Algorithm Hash digest
SHA256 ad6b774004febdad088b26bb0e53915d1f40e9da862d25872f0a317f3b30b518
MD5 4d80ab4489cd608f80a58fd9055692ae
BLAKE2b-256 522ef5825d3621e2130c779285547091bff80b4cc73e8a04511797b16cfe508a

See more details on using hashes here.

Supported by

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