A simple Python script to generate a JSON Feed for search for train tickets on Great Western Railway. Only supports one-way Standard class journeys.
Served over Flask!
Use the Docker build to host your own instance.
-
Set your timezone as an environment variable (see docker docs):
TZ=Europe/London
-
Access the feed using the URL with origin and destination station codes:
http://<host>/?from=BHM&to=EUS
-
Optionally, specify a:
- date (YYYY-MM-DD):
http://<host>/?from=BHM&to=EUS&on=2022-12-25
- time (HH:MM):
http://<host>/?from=BHM&to=EUS&at=12:00
- number of weeks to look ahead:
http://<host>/?from=BHM&to=EUS&weeks_ahead=2
- or any combination of the above
- date (YYYY-MM-DD):
-
(Advanced) Use a cron expression to specify a custom commuting schedule:
- weekdays 8.30am:
http://<host>/cron?from=BHM&to=EUS&job=30 8 * * 1-5
- weekends 2pm, 2 weeks from now:
http://<host>/cron?from=BHM&to=EUS&job=00 14 * * 6,7&skip_weeks=2
- weekdays 8.30am:
Note: set a longer timeout on your feed reader if you use the 'weeks_ahead' option
Tested with: