The schedule module

class pygtfs.schedule.Schedule(db_connection)

Represents the full database.

The schedule is the most important object in pygtfs. It represents the entire dataset. Most of the properties come straight from the gtfs reference. Two of them were renamed: calendar is called services, and calendar_dates service_exceptions. One addition is the feeds table, which is here to support more than one feed in a database.

Each of the properties is a list created upon access by sqlalchemy. Then, each element of the list as attributes following the gtfs reference. In addition, if they are related to another table, this can also be accessed by attribute.

Parameters:db_conection – Either a sqlalchemy database url or a filename to be used with sqlite.
agencies

A list of pygtfs.gtfs_entities.Agency objects

agencies_by_id(id)

A list of pygtfs.gtfs_entities.Agency objects with matching id

drop_feed(feed_id)

Delete a feed from a database by feed id

fare_rules

A list of pygtfs.gtfs_entities.FareRule objects

fares

A list of pygtfs.gtfs_entities.Fare objects

fares_by_id(id)

A list of pygtfs.gtfs_entities.Fare objects with matching id

feed_infos

A list of pygtfs.gtfs_entities.FeedInfo objects

feeds

A list of pygtfs.gtfs_entities.Feed objects

feeds_by_id(id)

A list of pygtfs.gtfs_entities.Feed objects with matching id

frequencies

A list of pygtfs.gtfs_entities.Frequency objects

routes

A list of pygtfs.gtfs_entities.Route objects

routes_by_id(id)

A list of pygtfs.gtfs_entities.Route objects with matching id

service_excpetions

A list of pygtfs.gtfs_entities.ServiceException objects

service_excpetions_by_id(id)

A list of pygtfs.gtfs_entities.ServiceException objects with matching id

services

A list of pygtfs.gtfs_entities.Service objects

services_by_id(id)

A list of pygtfs.gtfs_entities.Service objects with matching id

shapes

A list of pygtfs.gtfs_entities.ShapePoint objects

stop_times

A list of pygtfs.gtfs_entities.StopTime objects

stops

A list of pygtfs.gtfs_entities.Stop objects

stops_by_id(id)

A list of pygtfs.gtfs_entities.Stop objects with matching id

transfers

A list of pygtfs.gtfs_entities.Transfer objects

trips

A list of pygtfs.gtfs_entities.Trip objects

trips_by_id(id)

A list of pygtfs.gtfs_entities.Trip objects with matching id