Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.
/ tpp_gtfs_lib Public archive

Ruby library for dealing with GTFS. Used by TPP's FeedEater import pipeline.

Notifications You must be signed in to change notification settings

tpportugal/tpp_gtfs_lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GTFS Ruby

A Ruby wrapper for the General Transit Feed Specification

Getting started

Initialize a new GTFS source:

# Defaults to strict checking of required columns
source = GTFS::Source.build(<URI or Path to GTFS zip file>)

# Relax the column checks, useful for sources that don't conform to standard
source = GTFS::Source.build(<URI or Path to GTFS zip file>, {strict: false})

Accessing GTFS data from the source:

source.agencies
source.stops
source.routes
source.trips
source.stop_times
source.calendars
source.calendar_dates
source.fare_attributes
source.fare_rules
source.shapes
source.frequencies
source.transfers

Alternatively:

source.each_agency {|agency| puts agency}
...
source.each_transfer {|transfer| puts transfer}

Differences with nerdEd/gtfs

This fork extends nerdEd/gtfs with a number of additional features used by TPP. In some ways, however, it is also breaks compatibility; mainly, entity attribute names are now taken directly from the GTFS spec without removing "prefixes", e.g. stop.stop_timezone instead of stop.timezone

License

Copyright (C) 2012 Ed Schmalzle, with contributions 2015 Ian Rees

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Ruby library for dealing with GTFS. Used by TPP's FeedEater import pipeline.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages