Skip to content

read

gapline read <target> [-f PATH] [-w QUERY] [--format FORMAT] [-o PATH]

read loads a GTFS feed into memory and prints records from a single file. With --where, the output is filtered by a SQL-like expression; without it, every record is returned. Nothing is ever written to disk by this command.

The result respects the canonical column order of the GTFS spec. Output formats match validate: colored text (default), JSON, CSV, XML, or HTML.

ArgumentValues
<target>One of: agency, stops, routes, trips, stop-times, calendar, calendar-dates, shapes, frequencies, transfers, pathways, levels, feed-info, fare-attributes, fare-rules, translations, attributions. Underscored aliases (stop_times, calendar_dates, feed_info, fare_attributes, fare_rules) are also accepted.
FlagShortValueDescription
--feed-fPATHPath to the GTFS feed. Optional when [default] feed is set in a config file.
--where-wQUERYFilter expression in the query language. Omit to return every record in the file.
--formatFORMATOutput format: text, json, csv, xml, html. Defaults to text.
--output-oPATHWrite the results to this path instead of stdout.

Global flags are listed on reference/global-flags.

Terminal window
gapline read stops -f gtfs.zip
Terminal window
gapline read stops -f gtfs.zip --where "stop_id=S01"
Terminal window
gapline read stops -f gtfs.zip --where "stop_name LIKE Gare%"
Terminal window
gapline read stop-times -f gtfs.zip --where "trip_id=T1 AND stop_sequence>10"

AND has higher precedence than OR. Quote the expression so the shell does not split it on spaces.

Terminal window
gapline read routes -f gtfs.zip --where "route_type=3" --format csv -o buses.csv
Terminal window
gapline read stop_times -f gtfs.zip --where "trip_id=T1"
gapline read stop-times -f gtfs.zip --where "trip_id=T1"

Both kebab-case and underscore spellings resolve to the same target.

CodeMeaning
0Query ran successfully (including cases where zero rows matched).
1The --where expression could not be parsed.
2Configuration error.
3I/O error (feed not found, output path unwritable).

See concepts/exit-codes for the complete table.