Usage Overview¶
Once loaded:
%load_ext jupyternotifyplus
You have two main commands:
- %notifyme — triggers a notification after the cell finishes
- %notifyme here — triggers a notification immediately at that line
Notification Execution Behaviour¶
%notifyme schedules a notification for the next executed cell.
To ensure predictable behaviour:
- Notifications do not fire when a notebook is opened.
- Notifications only fire after a real cell execution.
- Internal state is stored privately and cleared immediately after use.
- No state is written into the user namespace.
This prevents stale notifications from appearing when reopening
notebooks and ensures that %notifyme behaves consistently across
sessions.
End-of-cell notification¶
%notifyme -t "Done" -m "Cell finished"
Inline notification¶
%notifyme here -t "Checkpoint" -m "Reached step 1"
You can use as many inline notifications as you want.
Variable and Expression Resolution¶
%notifyme supports Python variable names, expressions,
and f‑strings inside the -t (title) and -m (message) arguments.
This allows you to write expressive, dynamic notifications without string‑escaping or manual formatting.
Examples¶
Using variables¶
a = "Hello World"
%notifyme success -t a
The notification title becomes:
Hello World
Using f‑strings¶
%notifyme success -t f"1+1={1+1}"
Title:
1+1=2
Using expressions¶
%notifyme -t "3 * 7"
Title:
21
Resolution Rules¶
%notifyme resolves values using the following logic:
-
If the argument matches a variable name in the user namespace, its value is used.
-
Otherwise, the argument is evaluated as a Python expression (e.g., f‑strings, arithmetic).
-
If evaluation fails, the literal string is used unchanged.
This makes %notifyme flexible while remaining safe and predictable.