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]``). Another one is named without code:
module:factoryinOPENLOOPS_REMIND_DELIVERor in theremind.deliverkey of the openloops settings file (load_deliver()). Two optional parts of that protocol:redacts = True(it decides per channel what a push may show, so it is handed the real title andloop.reveal), andreplies()/ack(keys)(what the person tapped on a push:Done, Snooze, Drop), which
tick()applies to the loops (apply_replies()).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
daily for a week, then every 3 days. |
|
a DELETE (or a replacement under the same sequence id) of a scheduled message is acknowledged with a |
|
What a reply may ask, and the loop operation that carries it out. |
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 ( |
|
Make an open loop come back until it is done (or |
|
Whether a GitHub issue is closed ( |
|
Apply replies, 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 |
|
The |
|
The |
|
Apply what the person tapped on a push ( |
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. |
- openloops.remind.DFLT_REPEAT = {'after_days': 7, 'every_days': 1, 'then_every_days': 3}#
daily for a week, then every 3 days.
- Type:
How a reminder that repeats until done comes back
- 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.
- openloops.remind.REPLY_TYPES = ('done', 'snooze', 'cancel', 'dismissed')#
What a reply may ask, and the loop operation that carries it out.
- class openloops.remind.RemindSettings(channel='ntfy:', horizon_hours=71.0, generic_title='Reminder', generic_text='A reminder you set is due.', tz=None, morning='09:00', deliver=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).- property channel_label: str#
a topic in the reference is a bearer secret.
- Type:
The channel’s name only
- deliver: str | None = None#
Another
deliver, asmodule:factory(OPENLOOPS_REMIND_DELIVER; seeload_deliver()).
- 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.apply_replies(deliver, *, store, settings, now)[source]#
Apply what the person tapped on a push (
deliver.replies()), thenackit.Each reply is a mapping
{key, type, loop, value}:typeone ofREPLY_TYPES,loopthe loop id,valuea snooze length (1h,tomorrow). A reply whose key a loop’s log already holds is acknowledged without acting again, so a crash between applying and acknowledging repeats nothing. A reply that cannot be applied is not acknowledged and comes back next time; one for a loop that is gone, already closed or of an unknown type is acknowledged and counted.
- 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.configured_deliver(*, path=None)[source]#
The
remind.deliverreference in the openloops settings file, if any.A missing file or key means none; an unreadable file is an error, never a silent default (a reminder sent the wrong way is worse than one refused).
- 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.issue_closed(ref)[source]#
Whether a GitHub issue is closed (
gh);Nonewhen that cannot be told.
- openloops.remind.list_loops(*, state='open', store=None)[source]#
Loops as summaries, soonest first.
state:open,closed,allor one A2A state.
- openloops.remind.load_deliver(ref)[source]#
The
deliveramodule:factoryreference names: the factory, called with no arguments. The module is imported only here, so openloops depends on none of them.>>> load_deliver("collections:OrderedDict") OrderedDict() >>> load_deliver("no-colon") Traceback (most recent call last): ... ValueError: a deliver reference is module:factory, not 'no-colon'
- Return type:
- 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, until_done=False, issue=None, is_closed=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.until_donemakes it come back after each push (DFLT_REPEAT: daily at the first push’s time of day, every 3 days after a week) until it is closed:ol done, a cancel, or, withissue(owner/repo#N), that issue closing. With neitheratnorin_it first comes back at the nextsettings.morning.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(*, is_closed=None, store=None, deliver=None, settings=None, now=None)[source]#
Apply replies, arm what came within the horizon, record what fired, deliver late what was missed.
Replies first (
apply_replies(), whendeliverhasreplies), so a loop marked Done on the phone is not pushed again this tick. 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.
- openloops.remind.until_done(ref, *, issue=None, by='owner', only_source=None, is_closed=None, store=None, deliver=None, settings=None, now=None)[source]#
Make an open loop come back until it is done (or
issuecloses), keeping its time.Its next push stays where it is; each push re-arms it on
DFLT_REPEATat the same time of day.ol done(or a cancel) drops it.