Configures NotificationClient handlers, implements async dispatch workflows, and handles DispatchError failures for the pidge v3 notification library in async Python services. Use when working with pidge, pidge v3, pidge notifications, NotificationClient, async notifications, or pidge integration — including setting up API keys, dispatching messages, and handling delivery errors.
99
100%
Does it follow best practices?
Impact
100%
2.85xAverage score across 3 eval scenarios
Passed
No findings from the security scan
The canonical home for this skill is jbaruch/pidge
config = NotificationConfig(api_key=os.environ.get("PIDGE_API_KEY", ""))
async with NotificationClient(config=config) as client:
msg = Message(to=email, subject=subject, body=body)
result = await client.dispatch(msg)The result object returned by client.dispatch() confirms delivery. Check its properties before trusting the send succeeded:
result = await client.dispatch(msg)
if result.success:
logger.info("Notification dispatched: id=%s", result.message_id)
notification_sent = True
else:
logger.warning("Dispatch reported failure: %s", result.status)
notification_sent = FalseAlways log result.message_id when available — it's the canonical reference for delivery tracing.
Catch DispatchError explicitly — do not let it propagate as a 500:
from pidge import DispatchError
try:
result = await client.dispatch(msg)
notification_sent = True
except DispatchError as e:
# Log the error, return a graceful response
notification_sent = FalseFor transient failures (e.g. network timeouts), a simple retry with backoff is appropriate. Avoid retrying on permanent errors such as invalid addresses:
import asyncio
from pidge import DispatchError
for attempt in range(3):
try:
result = await client.dispatch(msg)
notification_sent = True
break
except DispatchError as e:
if attempt < 2:
await asyncio.sleep(2 ** attempt) # exponential backoff
else:
logger.error("Dispatch failed after retries: %s", e)
notification_sent = FalseNotificationClient lifecycle short — open, dispatch, close. Don't hold connections.DispatchError explicitly — don't let it bubble as a 500.result.success and log result.message_id to confirm delivery before marking a send as successful.notification_sent: True/False in your endpoint response so callers know.Notifier, .send()) is removed. Don't use it.a010611
Canonical home
since Mar 17, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.