Be downtown by noon.
Wake up at nine.

TrainTripTime works backwards from when you need to arrive — through the GO train timetable, live delays, and your local bus — to the minute you should leave home. Then it shows its work.

Python · stdlib onlyGTFS + GTFS-realtimesystemd socket activationVanilla JS PWARaspberry Pi
A plan: wake up, leave home, bus, train
The worked-out proof of a plan

Built for how commuting actually goes

Trip planners answer "what if I leave now?" This answers "when do I have to leave?" — with your own rules.

Backwards

From arrival to alarm

Latest train that makes it, the bus that lands you on the platform in your window, when to leave, when to wake.

Live

Knows what's running

GO departure status and platforms, line alerts, live bus predictions, and construction notices for the week you pick.

Proof

Shows its work

Every rule applied, every bus and train considered and why it lost, plus the exact feed versions used.

Honest

Says when there's no train

Weekend short-turns are detected from the timetable itself and reported plainly, with the closest option.

Yours

Your stop, your habits

Setup geocodes your address, takes any agency's GTFS, and lets you prefer the routes you'd really ride.

Light

Zero MB when idle

Socket-activated on a Raspberry Pi: it starts on your first tap and exits when you're done.

The algorithm

Deterministic, explainable, and small enough to read in one sitting.

1
Pick the trainFrom that date's service calendar, the latest trip from your station that reaches the destination by your target — skipping any the live board says are cancelled.
2
Fit the busBus trips that board near home and reach the station inside [departure − max wait, departure − platform buffer].
3
Rank with preferencesPreferred route in window → preferred route a little early → any route in window; within a tier, the one that lets you leave latest.
4
Walk, leave, wakeOpenStreetMap walking time (with per-stop overrides) plus your buffer gives the leave time; your prep rule gives the alarm.

Engineering under constraints

It lives on a shared 1 GB Raspberry Pi next to other services, so every byte had to justify itself.

118 → 1 MB

GO's stop_times.txt is streamed row by row and reduced to the trips that matter; requests only ever read the small index.

0 MB idle

systemd holds the port and hands the socket over on demand; the server exits after ten quiet minutes.

0 deps

Standard-library Python and vanilla JS. No build step, no package installs on the Pi.

Screens

Designed mobile-first to live on a home screen.

The plan
How it was worked out
Construction day
Setup

Run it

Python 3.10+. Open the page and it walks you through setup.

git clone https://github.com/shreywy/TrainTripTime.git
cd TrainTripTime
python server.py        # → http://localhost:8765