Skip to content

Add Great Britain and Sweden, read with keys from repository secrets - #6

Merged
davd-gzl merged 1 commit into
mainfrom
uk-sweden
Oct 7, 2026
Merged

davd-gzl merged 1 commit into
mainfrom
uk-sweden

Conversation

@davd-gzl

@davd-gzl davd-gzl commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Before: Great Britain and Sweden were missing because their timetables sit behind a free sign-up.

After: both are published as gb and se as soon as their keys are added as repository secrets. Until then they are left out quietly and nothing else changes.

Operator Source Secrets Kept
se Samtrafiken via Trafiklab, GTFS Sverige 2 (CC0) TRAFIKLAB_KEY SJ and other long-distance and night trains; regional trains between those stations; no commuter trains, Snälltåget, Arlanda Express, FlixTrain, Inlandsbanan or VR Snabbtåg
gb Network Rail open data SCHEDULE feed (attribution) NETWORK_RAIL_EMAIL, NETWORK_RAIL_PASSWORD Express trains and sleepers (LNER, Avanti, CrossCountry, GWR…); no stopping trains, Heathrow Express, Lumo or Eurostar

How: GTFS operators can name the environment variable holding their key, and {key} in the URL is replaced with it. Network Rail's feed isn't GTFS, so it gets its own reader. For each train it picks, date by date, the schedule in force: a short-term cancellation or overlay wins over the permanent one. It keeps public calls only and names stations from the feed's TIPLOC records. The stop-pair expansion moved into a helper shared with the GTFS reader. Both the publish workflow and the live-feeds job pass the secrets to npm run fetch.

Checked: npm run check (31 tests, including overlays, cancellations, trains running past midnight and non-public calls on a Network Rail fixture) and the fixture build, now with --gb. The real feeds can't be tried until the secrets exist.


Generated by Claude Code

Sweden comes from Trafiklab's GTFS Sverige 2 (CC0), which needs a free API
key; Great Britain from Network Rail's open data SCHEDULE feed, which needs
a free account. fetch reads TRAFIKLAB_KEY, NETWORK_RAIL_EMAIL and
NETWORK_RAIL_PASSWORD and leaves an operator out while its key is unset.

The Network Rail reader applies short-term overlays and cancellations over
each train's permanent schedule date by date, keeps public calls of express
trains and sleepers, and names stations from the feed's TIPLOC records. The
stop-pair expansion is shared with the GTFS reader.
@davd-gzl
davd-gzl merged commit 9509660 into main Oct 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant