Klepsydra a temporal expression language

Named after the Greek water clock. Famously bad at its one job.

For source and tests, see ~arrdem/source/projects/klepsydra.

Expression Evaluator

DSL Reference

Operators

every monday                          # recurring schedule
every monday, wednesday, friday       # comma-separated union
3rd tuesday of month                  # nth occurrence in scope
3rd march through 3rd november        # contiguous range
(A) during (B)                        # events from A within B
(A) except (B)                        # events from A not in B
(A) union (B)                         # merge both
(A) and (B)                           # intersection
first sunday after (every equinox)    # relative positioning
next tuesday                          # sugar: 1st after now
last full_moon                        # sugar: 1st before now
in 3 weeks                            # duration from now
every tuesday at 10:00am              # pin to time of day
let name be expr                      # bind a name
using hijri                            # set calendar scope

Calendar Vocabulary

gregorian  january..december, monday..sunday
julian     same month/weekday names
hijri      muharram, safar, ..., ramadan, ..., dhul_hijjah
hebrew     tishrei, cheshvan, ..., elul
discordian chaos, discord, confusion, bureaucracy, the_aftermath
republican vendemiaire, ..., fructidor, sansculottides
coptic     thout, paopi, ..., mesori, nasie
bengali    baishakh, joishtho, ..., choitro
darian     sagittarius..vrishchika (months), solis..saturni (sols)

Astronomical Events

full_moon / full_moons       new_moon / new_moons
first_quarter_moon           last_quarter_moon
equinox / equinoxes          solstice / solstices
aries_season .. pisces_season
Feed Configuration (TOML)
[feed]
name = "Street Sweeping"

[[events]]
when = "(3rd tuesday of month) during (march through november)"
title = "Street Sweeping - {when:%A %B %d}"
description = "Move your car by 8am"
location = "Garage side of street"
categories = ["chores", "city"]
transparent = true
alarm = "-15m"

[[events]]
when = "every friday at 17:00"
title = "Happy Hour"
url = "https://example.com"

Supported fields: when, title, description, location, url, categories, transparent, alarm (-15m, -1h, -1d). Title and description support {when:FORMAT} placeholders.