openloops.remind#
Reminders: loops kept in a store and delivered through a channel that holds the time.
The runner over openloops.loops (ADR-013). The core modules never import this
one: it is where a store, a clock and a delivery channel are composed, and it is the
only openloops code that sends anything for a reminder.
How a reminder survives a sleeping machine: when a loop comes within the horizon (three
days, ntfy’s limit), it is armed, handed to ntfy as a scheduled message whose
sequence id is the loop’s id. ntfy delivers it at remind_at whether or not this
machine is awake. Done or snoozed first, the scheduled copy is cancelled or replaced
by the same id, but ntfy.sh does not honour that today (UNCANCELLABLE_NOTE), so
the result carries a warning that the original push may still arrive. A tick (ol remind-tick, hourly from a launchd job) arms loops that
came within the horizon, records the ones that fired, and delivers late, saying so,
anything that was never armed.
Three seams, each one keyword argument with a default that works:
store: aMutableMapping[str, Loop]; default JSON files under~/.local/share/openloops/loops/(loops_store()).deliver: an object withschedule,nowandcancel; defaultNtfyDelivery, through correspond’s ntfy channel (``pip installopenloops[remind]``).
settings:RemindSettings; default from the environment.
Privacy. ntfy.sh is a public relay: anyone holding the topic reads the push. A
push says only that a reminder is due unless the loop was made with reveal=True;
the title then travels too. Reveal short labels only, never names, clients or secrets.
Module Attributes
a DELETE (or a replacement under the same sequence id) of a scheduled message is acknowledged with a |
Functions
|
The default store: |
|
A duration such as |
|
An ISO date-time (naive means |
|
A duration from |
|
|
|
|
|
Make a loop that comes back at |
|
Loops as summaries, soonest first. |
|
Close a loop as done and cancel its scheduled push, if any. |
|
Bring a loop back later ( |
|
Arm what came within the horizon, record what fired, deliver late what was missed. |
|
A loop by id, by a unique prefix (with or without |
|
Move loop |
|
The method's review packet over every stored loop: the exceptions to decide on. |
|
What to do now, best first, under |
Classes
|
What the owner sets once. |
|
The default |
|
|
Exceptions
The channel refused or could not be reached; the loop is left to the next tick. |
- exception openloops.remind.DeliveryError[source]#
Bases:
RuntimeErrorThe channel refused or could not be reached; the loop is left to the next tick.
- class openloops.remind.LoopsStore(files)[source]#
Bases:
MutableMappingLooprecords as<id>.jsonfiles, each write atomic.
- class openloops.remind.NtfyDelivery(ref='ntfy:', *, send=None, get_channel=None)[source]#
Bases:
objectThe default
deliver: correspond’s ntfy channel, one sequence id per loop.sendandget_channeldefault to correspond’s, imported when first used, soimport openloops.remindcosts nothing and tests inject fakes.
- class openloops.remind.RemindSettings(channel='ntfy:', horizon_hours=71.0, generic_title='Reminder', generic_text='A reminder you set is due.', tz=None)[source]#
Bases:
objectWhat the owner sets once.
from_envreadsOPENLOOPS_REMIND_*andOPENLOOPS_TZ.channelis a correspond reference (ntfy:is the default topic).tzis an IANA zone for reading and echoing times;Noneuses the machine’s own, with its daylight-saving rules applied per instant.horizon_hoursis capped at 71 (ntfy schedules three days ahead at most).
- openloops.remind.UNCANCELLABLE_NOTE = 'ntfy.sh still delivers a scheduled push that was cancelled or replaced, so the original push may arrive at {at} anyway'#
a DELETE (or a replacement under the same sequence id) of a scheduled message is acknowledged with a
message_deleteevent, yet the original is still delivered at its time. ntfy’s documentation says otherwise; until the server honours it, an earlydoneorsnoozeis said, not hidden.- Type:
Measured on ntfy.sh, 2026-11-19
- openloops.remind.attach(naive, zone)[source]#
naiveread inzone;Nonemeans this machine’s zone, DST rules included.>>> attach(datetime(2026, 7, 1, 9, 0), timezone.utc).isoformat() '2026-07-01T09:00:00+00:00'
- Return type:
- openloops.remind.done(ref, *, note=None, by='owner', only_source=None, store=None, deliver=None, settings=None, now=None)[source]#
Close a loop as done and cancel its scheduled push, if any.
- openloops.remind.engage(*, limit=None, method=None, store=None, now=None, **criteria)[source]#
What to do now, best first, under
method;criteriaare the method’s filters.A criterion the method does not list (GTD: context, minutes, energy) is refused, and an empty one ignored.
- openloops.remind.find(store, ref, *, only_source=None)[source]#
A loop by id, by a unique prefix (with or without
loop-), or by its hex suffix.only_sourcenarrows the search to loops whosesource.refis exactly that: a surface that may only touch what it set itself (a voice connector) passes its own name, and every other loop is, for it, not there.- Return type:
- openloops.remind.list_loops(*, state='open', store=None)[source]#
Loops as summaries, soonest first.
state:open,closed,allor one A2A state.
- openloops.remind.local(when, zone)[source]#
whenshown inzone, or in this machine’s zone (DST-aware) whenNone.- Return type:
- openloops.remind.loops_store(rootdir=None)[source]#
The default store:
~/.local/share/openloops/loops/<id>.json.- Return type:
- openloops.remind.organise(ref, place, *, by='owner', accepted=False, only_source=None, method=None, store=None, deliver=None, settings=None, now=None, **fields)[source]#
Move loop
reftoplaceundermethod(default GTD), settingfields.fieldsare the method’s (GTD: project, area, contexts, energy, minutes, waiting, remind_at, due); aremind_atorduemay be a duration or a time, as forremind().accepted=True(only on the owner’s own yes) turns an agent’s proposal into a commitment. The loop is then settled: a new time is armed, a cleared one disarmed.
- openloops.remind.parse_at(text, *, now, zone)[source]#
An ISO date-time (naive means
zone), an ISO date (09:00 that day) orHH:MM(the next one). Natural language is the calling agent’s job, not this function’s.>>> z = timezone.utc >>> now = datetime(2026, 11, 19, 12, 0, tzinfo=z) >>> parse_at("09:30", now=now, zone=z).isoformat() '2026-11-20T09:30:00+00:00' >>> parse_at("2026-11-21", now=now, zone=z).isoformat() '2026-11-21T09:00:00+00:00'
- Return type:
- openloops.remind.parse_in(text)[source]#
A duration such as
20m,3h,2dor1h30m.>>> parse_in("1h30m") datetime.timedelta(seconds=5400)
- Return type:
- openloops.remind.parse_when(text, *, now, zone)[source]#
A duration from
now(3h,1h30m) or a time (parse_at()): the one form a CLI flag takes.>>> now = datetime(2026, 11, 19, 12, 0, tzinfo=timezone.utc) >>> parse_when("3h", now=now, zone=timezone.utc).isoformat() '2026-11-19T15:00:00+00:00'
- Return type:
- openloops.remind.remind(title, *, at=None, in_=None, due=None, reveal=False, source=None, by='owner', daily_cap=None, place=None, waiting=None, method=None, store=None, deliver=None, settings=None, now=None)[source]#
Make a loop that comes back at
at(or afterin_), arm it, and say when.placeis where the organisingmethod(default GTD) files it; by default, where it sends an actionable item (GTD:next). A loop onsomedaywith a time is an incubated item that comes back on that date; one onwaitingneedswaiting={"on": <whom>}.Give at most one of
atandin_; with neither, the loop is listed but never pushed. Returns the loop’s summary andecho, the one line to repeat to the owner.daily_caprefuses a new loop once that many loops from the samesource.refwere created in the last 24 hours: a surface driven by a model that reads other people’s text pins it, so a steered loop cannot flood the phone or the push quota.
- openloops.remind.review(*, method=None, store=None, now=None)[source]#
The method’s review packet over every stored loop: the exceptions to decide on.
- openloops.remind.snooze(ref, *, until=None, for_=None, by='owner', only_source=None, max_ahead=None, store=None, deliver=None, settings=None, now=None)[source]#
Bring a loop back later (
untila time, orfor_a duration); re-arms its push.
- openloops.remind.tick(*, store=None, deliver=None, settings=None, now=None)[source]#
Arm what came within the horizon, record what fired, deliver late what was missed.
Model-free and idempotent: run it as often as you like (the launchd job runs it hourly). Returns counts per action and the loops whose channel call failed.