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.1.tar.gz (7.4 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.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: darwin_notifications-0.0.1.tar.gz
  • Upload date:
  • Size: 7.4 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.1.tar.gz
Algorithm Hash digest
SHA256 03f55d96f9e0ba18fd961a940e3e9a63dc6a1709c03f42e49d1b0bc2d1a82157
MD5 ed6f7f100a181c95c1309d0d0cd82a18
BLAKE2b-256 f97b059a7ad599a402fed46124692623fab919fe37d60b5069d38ba1eb1e22ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for darwin_notifications-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ccfdd8121e9446bee6eab2983e2a275129388e892704d6b3d405a6e0a8d79fe
MD5 85412f15676d5f9f5222efc55c98b0bd
BLAKE2b-256 d007cc4b09418dbd5439b26f8e41619f968ebff833a607055e5cbe9f03634095

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