Repository navigation
Conversation
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.
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.
Before: Great Britain and Sweden were missing because their timetables sit behind a free sign-up.
After: both are published as
gbandseas soon as their keys are added as repository secrets. Until then they are left out quietly and nothing else changes.seTRAFIKLAB_KEYgbNETWORK_RAIL_EMAIL,NETWORK_RAIL_PASSWORDHow: 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 tonpm 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