timetables.txt

This is an optional, non-standard file called timetables.txt which can be included in an agency's GTFS. This file specifies to GTFS-to-HTML which HTML timetables should be built. Often, this is the only additional file you need to create to use GTFS-to-HTML.

Column Definitions

column namedescription
timetable_idA unique ID for the timetable
route_idThe ID of the route the timetable is for from routes.txt.
direction_idThe direction_id from trips.txt for the timetable. This can be blank.
start_dateThe start date for this timetable in YYYY-MM-DD format.
end_dateThe end date for this timetable in YYYY-MM-DD format.
mondayA binary value that indicates whether this timetable should include service on Mondays. Valid options are 0 and 1.
tuesdayA binary value that indicates whether this timetable should include service on Tuesdays. Valid options are 0 and 1.
wednesdayA binary value that indicates whether this timetable should include service on Wednesdays. Valid options are 0 and 1.
thursdayA binary value that indicates whether this timetable should include service on Thursdays. Valid options are 0 and 1.
fridayA binary value that indicates whether this timetable should include service on Fridays. Valid options are 0 and 1.
saturdayA binary value that indicates whether this timetable should include service on Saturdays. Valid options are 0 and 1.
sundayA binary value that indicates whether this timetable should include service on Sundays. Valid options are 0 and 1.
start_timeA time in HH:MM:SS format used exclude all trips that start before this time. Optional, default is to use all trips throughout the day.
end_timeA time in HH:MM:SS format used exclude all trips that start on or after this time. Optional, default is to use all trips throughout the day.
include_exceptionsA binary value that indicates whether or not to include exceptions of type 1 from calendar_dates.txt, such as holiday service on a weekday. Valid options are 0 and 1. Optional, defaults to 0 (exceptions are not included by default).
timetable_labelA short text label describing the timetable, for instance "Route 4 Northbound Mon-Fri". Optional, defaults to route name and first and last stops. Optional.
service_notesText shown on the timetable about the service represented. Optional.
orientationDetermines if the top row should be a list of trips or stops. Valid options are vertical, horizontal or hourly. vertical shows stops across the top row with each row being a list of stop times for each trip. horizontal shows trips across the top row with each row being stop times for a specific stop. hourly is for routes that run the same time each hour and will print a simplified schedule showing minutes after the hour for each stop. horizontal orientation is best for routes with lots of stops and fewer trips while vertical orientation is best for routes with lots of trips and a smaller number of stops. Optional, default is vertical.
timetable_page_idThe timetable page that should include this timetable. Optional.
timetable_sequenceThe order that this timetable should appear on the timetable page. Optional.
direction_nameThe human readable name of the direction of the timetable, such as "Southbound". Optional.
show_trip_continuationA binary value that indicates whether this timetable should show an additional column(s) or row(s) indicating which trips continue from a different route or continue on as a different route. This is calculated by trips that share the same block_id in trips.txt. Valid options are 0 and 1. Optional, defaults to 0.

Example

timetable_id,route_id,direction_id,start_date,end_date,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_time,end_time,include_exceptions,timetable_label,service_notes,orientation,timetable_page_id,timetable_sequence,direction_name,show_trip_continuation
0,2034,0,20150101,20151122,1,1,1,1,1,1,0,00:00:00,13:00:00,0,101 Northbound,Mon-Sat AM,horizontal,1,0,Northbound,0
1,2034,0,20150101,20151122,1,1,1,1,1,1,0,13:00:00,24:00:00,0,101 Northbound,Mon-Sat PM,horizontal,1,1,Northbound,0
2,2035,1,20150819,20151122,1,1,0,1,1,0,0,,,0,101T Northbound,"Mon,Tue,Thur,Fri",horizontal,1,0,Northbound,0
3,2035,0,20150819,20151122,0,0,1,0,0,0,0,,,0,101T Southbound,Wednesday,horizontal,1,0,Southbound,0
4,2036,1,20150101,20151122,0,0,0,0,0,0,1,,,0,102 Eastbound,Sunday,horizontal,1,0,Eastbound,0
5,2036,0,20150101,20151122,1,1,1,1,1,0,0,,,0,102 Westbound,Mon-Fri,horizontal,1,0,Westbound,0
6,2036,1,20150101,20151122,0,0,0,0,0,1,0,,,0,102 Eastbound,Saturday,horizontal,1,0,Eastbound,0
7,2037,0,20150101,20151122,1,1,1,1,1,0,0,,,0,103 Westbound,Mon-Fri,horizontal,1,0,Westbound,0

An example of this file is located in examples/timetables.txt.

Multi-route Timetables

To allow creating a single timetable for multiple routes that overlap, you can have multiple entries in timetables.txt for the same timetable_id. All fields should be the same for each row in timetables.txt for a combined route timetable except route_id.