This example demonstrates how to split a GTFS zip file into multiple files, one for each specified agency_id, using the gtfs_df Ruby gem.
bundle install
ruby split_by_agency.rb -i <input-gtfs.zip> --ids agency1,agency2
- The output files will be written to the
output/directory, named<agency_id>.zip.
-i,--input PATH— Path to the input GTFS zip file--ids IDS— Comma-separated list of agency IDs to extract
ruby split_by_agency.rb -i ../../spec/fixtures/sample_gtfs.zip --ids DTA,OTA
This is a port of the original Python script using Partridge.