Skip to main content

Post darwin-based notifications using NSUserNotification API

Project description

darwin-notifications

A tiny, dependency‑light macOS Notification Center helper that posts banners from Python without PyObjC, using ctypes + the Objective‑C runtime. Ships a simple CLI implemented with Typer and a small Python API you can call from your scripts.

⚠️ Apple deprecated NSUserNotification in favor of UserNotifications.framework. For quick, fire‑and‑forget banners from non‑sandboxed tools, NSUserNotification still works on current macOS releases. This package sticks to ctypes on purpose—no extra bridge layers.

Features

  • Pure ctypes: no PyObjC required
  • One‑liner CLI to send a notification banner
  • Minimal Python API for programmatic use
  • Works from Terminal/iTerm (GUI session)
  • Optional default sound toggle

Install

With pip:

python3 -m pip install darwin_notifications

With uv:

uv pip install darwin_notifications

Quick Start

CLI

# Basic
notify --title "Build finished"

# With subtitle and body
notify -t "Hello" -s "From darwin_notifications" -m "Deployed successfully" --sound

Run --help for all options:

notify --help

Python API

from darwin_notifications.api import notify

notify(
    title="Hello from Python",
    subtitle="Optional subtitle",
    text="Optional informative text",
    sound=True,
)

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

darwin_notifications-0.0.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

darwin_notifications-0.0.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file darwin_notifications-0.0.2.tar.gz.

File metadata

  • Download URL: darwin_notifications-0.0.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for darwin_notifications-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d3ec0e30bcaa6f8e395841a806164d13098ac282d020859dfe68c048679dbf76
MD5 4ecd4c76cdc06eb433251cb1cdb8c6b7
BLAKE2b-256 38c9260eaf02a1c896c744648caac89e66381f36c6ef2eca47afe15d6cd4d7de

See more details on using hashes here.

File details

Details for the file darwin_notifications-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for darwin_notifications-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 002cc3bed1b24fd358febd778cdd8eb0b1512b3ed6cb977ba71de04c6a646661
MD5 99c47c5bc0f8ab99fb515937911d35d3
BLAKE2b-256 1eb8997adfa9f0ca7be0cffaf076d13aa9ec2b670a5f0b1f3f1c0338e91dc6d5

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 Pingdom Monitoring Sentry Error logging StatusPage Status page