Repository navigation
Leave-by times from Apple Maps travel times (K660) - #29
Merged
Merged
Conversation
The owner keeps every calendar in Apple's Calendar app, so travel times come from MapKit, with no key or account. ek eta asks Apple Maps for the trip, with the arrival time so traffic is predicted for it. ek events now gives an event's map location when it has one, and eta.py turns the day's events into leave-by times with a buffer, a daily lookup limit, one refresh near the start, and a cache that holds no places or titles. The briefing rule uses only its times. Tested: 12 tests with a stand-in for ek; real lookups between two public places by address, place name, coordinates and transit. Traffic is reflected: 34 minutes arriving at a weekday rush hour, 19 early on a Sunday, same distance. Not tested: a real day's events. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
K660. Owner (Simon chat, 2026-11-15), on where travel times should come from: "yes but i already use the apple cal app and add all my accounts to that..."
What it adds
ek eta: Apple Maps travel time through MapKitMKDirections.calculateETA, with no key or account. Takes an address, a place name (falls back toMKLocalSearchwhen the address lookup doesn't know it) orLAT,LONfor both ends.--arrivesets the arrival time so Apple predicts traffic.--transport car|walk|transit. Nothing is stored.ek eventsnow includesgeo(the event's map location) when Calendar has one, so most lookups skip the address search.engine/tools/eta.py day [--date] [--json]: leave-by times for the day's events with a place.eta_daily_lookups(12) a day.eta_buffer_minutes(10).eta_from(required, so nothing is looked up until it's set),eta_transport,eta_buffer_minutes,eta_daily_lookups.Live traffic test (two public places, Ferry Building to SFO, 22.7 km). Arrival times in this Mac's time zone:
Same distance each time, so traffic is reflected, both predicted and current.
Tested: 12 tests in
tests/test_eta.py(now inscripts/ci-checks.sh), with a stand-in for ek: the leave-by maths, the arrival time passed, map locations used, skip rules, no starting point means no lookups, the lookup budget, the daily limit, a new day, failed lookups reported, "leave now", and no places or titles in the cache. Real lookups by address, by place name, by coordinates and by transit.Not tested: a real day's events from the owner's calendar. Every trip starts from
eta_from, not from the event before; that's a stated limit.Needs the owner: setting
eta_fromin config.json.🤖 Generated with Claude Code