PkgWatch is a small package-delivery monitor for macOS. It polls carriers directly. When a package is delivered, it plays a loud, repeating siren on the Mac and sends an emergency-priority Pushover push to the iPhone. Both keep going until you acknowledge one of them.
- Pure Python standard library: no
pip install, no cloud, no subscriptions (Pushover is a one-time ~US$5). - Runs as a LaunchAgent, independent of any terminal or Claude Code session.
- Everything happens in a local web page: http://127.0.0.1:8787/ .
Local UI after the first real delivery: the alarm fired 2 min after the driver's scan and ~17 min before Amazon updated; it was acknowledged 6 s later. Tracking numbers in the screenshot are replaced with dummies.
Packages left in a shared lobby or at the door can be stolen within minutes. Amazon's own "Delivered" notification often arrives well after the driver has actually dropped the package off. The carrier records the delivery first, and Amazon picks it up later.
PkgWatch watches the carrier directly and sounds an alarm the moment the carrier marks the package delivered. You can get downstairs before anyone else does.
On the first real delivery it was tested on:
| Event | Time |
|---|---|
| Driver scans package as delivered | 2:15:30 PM |
| PkgWatch alarm (Mac + iPhone) | 2:17:36 PM |
| Amazon shows "Delivered" | 2:35 PM |
That's ~17 minutes earlier than Amazon. A second ASL delivery repeated it almost exactly: scan 4:25:16 PM, PkgWatch alarm 4:27:40 PM, Amazon 4:44 PM, so ~16Β½ minutes ahead. ASL doesn't send its own delivery email, so without PkgWatch, Amazon was the first to tell you.
It's not only about speed. Intelcom already emails the moment the driver scans. On one Intelcom delivery, the scan, Intelcom's email and the PkgWatch alarm all landed within the same 15 seconds, and Amazon's page caught up within ~3 minutes. That email would have gone unnoticed for a while. The siren and an iPhone alert that rings through Do Not Disturb until acknowledged did not.
| Driver scan β Amazon | Carrier's own email | PkgWatch | |
|---|---|---|---|
| ASL (2 deliveries) | ~20 min, ~19 min | none | alarm ~2 min after scan, ~16β17 min before Amazon |
| Intelcom | under 3 min | same minute | alarm 15 s after scan; impossible to miss |
Small sample (two ASL deliveries, one Intelcom delivery); the numbers will vary by carrier and day.
You need a Mac with Python 3.10 or newer (check with python3 --version; if it's older, run brew install python). Nothing else.
1. Install (one time; starts automatically at every login):
git clone https://github.com/khordoo/parcel-delivery-alarm.git && cd parcel-delivery-alarm && ./scripts/install-launchagent.sh
2. Open http://127.0.0.1:8787
3. Paste your tracking number and click Add. That's it.
When the carrier marks the package delivered, your Mac plays a siren until you click Acknowledge. Click Mac alarm only on the page once to hear what it sounds like.
- Supported out of the box: ASL Distribution ,Intelcom / Dragonfly ,Precision Parcel . The carrier is detected from the number.
- Other carriers: paste the carrier's tracking-page URL instead of the number.
- Keep the Mac on with the lid open while you wait. The screen may turn off; that's fine.
Want the alert on your phone too, so it reaches you away from the Mac? It keeps ringing until you acknowledge it.
Install Pushover Notifications (by Pushover, LLC) from the App Store and create an account. It has a 30-day free trial, then a one-time ~US$5.
2.
On https://pushover.net , log in and copy yourUser Key (top right).
3.
On the same page, click Create an Application/API Token , name itPkgWatch , and copy theAPI Token .
4.
In PkgWatch ( http://127.0.0.1:8787 ), paste both into thePushover section and clickSave to Keychain .
5.
Make sure the alert can ring when your phone is on Do Not Disturb or Focus. Otherwise it may only show on screen without sound (the "Time Sensitive" setting alone does not make it ring). Either:
- Recommended: open thePushover app (not iPhone Settings) β Settings and turn onCritical Alerts for emergency priority. Optionally also turn it on for high priority. Allow it when iOS asks, and check the critical-alert volume there. The alert then rings through Do Not Disturb, every Focus and the Silent switch. iPhone Settings β Notifications β Pushover only shows a Critical Alerts toggle after this step. Or:
- add Pushover to theallowed apps ofevery Focus you use (Do Not Disturb, Sleep, Workβ¦), and keep the Silent switch off. In the same Pushover app settings, turn off* Always use high-priority default* . Otherwise the app replaces PkgWatch's long alarm sound with a short chime.
Turn on Do Not Disturb and click Test both channels . The Mac and the phone should both ring. Acknowledging on either one stops both.
Your keys are stored in the macOS Keychain, never in a file.
pkgwatch/
models.py Status enum, TrackingResult, Package, TrackingError (failure β unchanged)
classify.py ordered, deterministic text β Status rules (EN/FR); negatives win over "delivered"
http.py stdlib HTTP session; transport failures, 429, 5xx, bot walls β TrackingError
carriers/ one file per carrier, auto-discovered via @register
intelcom.py asl.py precision.py generic.py (custom URL) simulator.py (testing)
monitor.py scheduler, backoff, dedup, alert fan-out, ack, Pushover receipt polling
alarm.py generated siren via afplay loop + modal "Acknowledge" dialog, volume boost/restore
notify.py macOS Notification Center + Pushover client (with retries)
keychain.py Pushover secrets in the login Keychain
power.py caffeinate -i -w <pid>
web.py + static/ local UI and JSON API (127.0.0.1 only, Host check + CSRF header)
Adding a carrier. Drop pkgwatch/carriers/foo.py with a Carrier subclass decorated with @register. It must implement track(pkg) -> TrackingResult and raise TrackingError on failure. Optional parts: patterns (auto-detect), url_hosts/ url_params (URL parsing), min_interval, enrich(). You don't need to touch the core.
Adding a package. Paste a tracking number or URL.
- Detection order: URL host, then number pattern, then a cheap probe of the probe-capable carriers, then manual choice.
- An unrecognised URL becomes a custom URL package. It gets a plain GET plus strict delivery phrases, and you can give it your own "delivered" phrase. Pages that only render with JavaScript, need a login, or show a CAPTCHA are reported as errors. They are never bypassed.
Statuses. unknown, not_found, info_received, in_transit, out_for_delivery, attempted, exception, available_for_pickup, delivered, returned.
- Alarm statuses (configurable):
deliveredandavailable_for_pickup. - Heads-up only (no alarm): out for delivery, attempted, exception.
- Polling stops at: delivered, ready-for-pickup, returned.
ASL race mode.
- While an ASL package is out for delivery and Precision Parcel is the final-mile carrier, every poll also queries Precision in the background.
- Whichever source reports delivered / ready for pickup first triggers the alert:
- The fast ASL poll (~1β2 s) never waits for Precision, which can take ~25 s.
- When Precision finishes with a final status, it wakes the monitor for an immediate re-check instead of waiting for the next 30 s tick.
- Only final statuses from Precision may override ASL, so the displayed status never flip-flops. The persisted
alerted_atguard keeps it to a single alert even when both sources agree. - After the alert, the slower source is watched for up to 10 min. The log then records which source won and by how much (
python3 -m pkgwatch timeline).
Reliability rules.
- Failed request β unchanged status. On a failure the last known status is kept.
consecutive_errors,last_errorandlast_success_atare shown in the UI ("status may be stale"). - Backoff. Retries wait 10 s, 20, 40, 80, 160, then cap at 300 s. A
Retry-Afterheader is honoured. A bot wall or CAPTCHA backs off 15 min. After 10 consecutive failures (configurable) you get one "Tracking is failing" warning. - Duplicate prevention.
alerted_atis persistedbefore any notification goes out, so a restart or crash can't send a second push. If the app restarts with an alarm still unacknowledged (within 24 h), the local siren resumes but no new push is sent. - Acknowledgement. Acknowledging anywhere stops everything:
- The UI button, the Mac dialog, or the Acknowledge button in Pushover on the phone (receipt polled every 15 s) all count.
- A local ack cancels the Pushover emergency retries.
- The UI button, the Mac dialog, or the
- Fan-out. Siren, Mac notification and Pushover are fired on separate threads, so a slow network doesn't delay the siren.
- Polling. Default is 30 s with Β±5 % jitter. Each adapter has a floor: Intelcom 30 s (its CDN cache), custom URLs 60 s. The UI's "Check now" forces an immediate poll.
The first live ASL delivery went like this:
- The driver's scanner logged Delivered β Safe location at 14:15:30.
- ASL's tracking site first showed it at 14:17:36.
- PkgWatch fired the Mac siren, the Mac notification and an emergency Pushover push in the same second.
- The alert was acknowledged 6 s later.
- Amazon's site showed Delivered only at14:35 , about 17 min after the PkgWatch alarm and about 20 min after the driver's scan.
Roughly 2 min of the gap was upstream: the scanner sync plus ASL's site, which kept saying "Out for Delivery" on three polls after the scan time. PkgWatch's own share was under 30 s. Race mode (above) was added to find out whether Precision's tracker is ahead of ASL's.
On the second ASL delivery, race mode answered that: Precision reported Delivered 18 s before ASL's site did. The alert fired 2 min 48 s after the driver's scan. The iPhone push was what got noticed, because the Mac siren was playing through a sleeping external monitor. That's now fixed (see Limitations β Audio).
Tested in November 2026 with a real ASL package (out for delivery β delivered) and a real Intelcom package (delivered to a pickup point). Numbers below are illustrative.
| Approach | Latency | Reliability | Coverage | Cost / auth | Verdict |
|---|---|---|---|---|---|
Intelcom public JSONGET intelcom.ca/cfworker/v3/tracking/{id}/ |
~0.1 s response; Cloudflare cache max-age=30 s | Structured, has carrier's own isDelivered flag and status codes |
Intelcom/Dragonfly | Free, no auth | Used |
ASL site AJAXPOST asldistribution.com/wp-admin/admin-ajax.php action=order_tracking |
~2 s, uncached ( no-store ) |
HTML fragment (parser can break on redesign); dates only, no times | ASL incl. its final-mile partners | Free, no auth, no CAPTCHA (page nonce not enforced) | Used (primary for ASL) |
Precision Parcel JSONtrack.precisiondeliveries.com/api/shipment-itemId/{id} |
0.3β25 s (slow, variable; occasional transient upstream errors) | Structured; exact UTC scan times, signature/photo flags | ASL packages whose final mile is Precision | Anonymous session cookie, the same one the public site creates for every visitor | Raced against ASL while out for delivery; fallback; exact timestamps |
| Carrier webhooks | n/a | Neither carrier offers a public developer webhook. Precision has SMS/e-mail opt-in only | β | β | Not usable programmatically |
| 17TRACK API | Refreshes every 6β12 h (up to 24 h) | Good | Both carriers listed (keys 100555, 100989) | $19 / 300 shipments, API key | Too slow as a primary source |
| AfterShip | Refreshes every 3β12 h | Good | Broad | Paid plans | Too slow |
| Ship24 | Not published (free: 10 shipments/mo) | Good | Broad | API key | Too slow / too limited |
| Playwright / browser automation | Same data as above, heavier | β | β | β | Not needed: every page is backed by an API |
| Amazon tracking page | β | Needs Amazon login (auth wall) | β | β | Skipped: we don't automate authenticated sessions |
| LLM page interpretation | β | β | β | β | Not needed: everything is deterministic. A small model (e.g. Claude Haiku 4.5) could later classify unfamiliar pages, but it is not used for routine detection. |
Decision. Use direct carrier endpoints. They beat the universal trackers by hours. The universal services are worth adding only as an optional slow backstop for carriers with no adapter.
- Detection latency is roughly poll interval + carrier propagation + cache.
- Intelcom's endpoint is CDN-cached for 30 s, so worst case is ~60 s after Intelcom records the event.
- ASL is uncached. Worst case is ~30 s plus ASL's response time (~2 s).
- What can't be measured from here is how long the driver's scanner takes to sync to the carrier. That is usually seconds, but can be minutes in poor cell coverage.
- ASL timestamps are date-only. For Precision-delivered ASL packages, PkgWatch fetches Precision's exact scan timeafter sounding the alarm, so the slow Precision API never delays the alert. The UI shows carrier-time β detection latency where it is known.
- Endpoints are unofficial. These are the same public endpoints the carriers' own tracking pages use, not documented APIs. A redesign can break a parser. That shows up as a visible error (and a warning after N failures), never as a silent "no change". Polling stays low-rate (one request per package per 30 s) and identifies itself in the User-Agent.
- Sleep, lid and power. -
caffeinate -iblocksidle system sleep while any package is active or an alarm is ringing. The display still sleeps. It is released when nothing is active, and it dies with the app (-w pid).- Closing the MacBook lid sleeps the Mac anyway. The exception is clamshell mode (power + external display + keyboard/mouse). While asleep, nothing polls and the siren can't play. Keep the lid open, or rely onβ¦
- β¦Pushover. It only reaches the phone if the Mac was awake when the delivery was detected. A sleeping Mac detects nothing.
- Low battery or the menu β Sleep also override caffeinate.
- Network loss. Polls fail and back off (capped at 5 min, so recovery is quick), and the UI marks the status stale. Pushover sends retry 4Γ with backoff. If the Mac is offline, the push can't be sent, but the local siren still plays once the delivery is detected.
- Restarts and logouts. - The LaunchAgent starts at login , not at boot. After a reboot nothing runs until you log in. Enable automatic login if you need unattended recovery.
- State persists, so monitoring resumes where it left off. Unacknowledged alarms resume locally.
- The LaunchAgent starts at
- Audio. - By default the siren plays on the built-in speakers : during an alarm the system output is switched to them and restored on acknowledge. Reason: an external monitor's speakers go silent when the display sleeps, which made the second real alert inaudible. SetAlarm speaker to
defaultor part of a device name to change this.- Anything else playing audio moves to the built-in speakers while the alarm sounds.
- Volume is raised during the alarm and restored afterwards, but only on devices with software volume. Outputs without software volume (e.g. HDMI/DisplayPort audio, some interfaces) play at the device's own level.
- Focus modes don't block
afplay. The Mac notification itself can be suppressed by Focus.
- By default the siren plays on the
- Dialog and notification permissions. The first time, macOS may ask to allow notifications from "Script Editor"/
osascript. Allow it in System Settings β Notifications. - Amazon isn't monitored. Its tracking requires your Amazon login, which this app deliberately doesn't automate.
Command line (run inside the project folder):
python3 -m pkgwatch set-pushover # store Pushover keys from the terminal
python3 -m pkgwatch check ASL0012345678 # one-shot lookup, no state/alerts
python3 -m pkgwatch timeline # detection + notification timestamps
python3 -m pkgwatch test-alarm --seconds 5 # hear the siren
python3 -m pkgwatch serve --port 8787 # run in foreground instead of launchd
./scripts/uninstall-launchagent.sh # stop and remove (keeps data)
PYTHONPATH=.:tests python3 -m unittest discover -s tests # 53 tests
Data lives in ~/Library/Application Support/PkgWatch/:
state.json: packages, last status, settings. Written atomically.events.jsonl: every poll, status change, error, alert, notification and acknowledgement, with epoch and local timestamps.pkgwatch.log: rotating application log.
Pushover details. Credentials are stored in the macOS login Keychain (service pkgwatch.pushover) through security -i on stdin, so they never show up in process lists, state.json or logs. To inspect or delete them: Keychain Access β search "PkgWatch". Environment variables PUSHOVER_APP_TOKEN / PUSHOVER_USER_KEY override the Keychain if set. Delivery alerts use Pushover priority 2 (emergency) with retry=30 s, expire=3600 s and sound persistent, all configurable.
Restart after changing the code: launchctl kickstart -k gui/$(id -u)/com.pkgwatch.agent