README

August 21, 2010 ยท View on GitHub

Rewrite of transitfeed

import gtfs sched = gtfs.load( "bart.zip" )

( it takes a minute or two to load )

sched.stops [, , , , , , , , , , , , , , <Stop 12TH_N>, , <Stop 12TH>, <Stop 16TH>, <Stop 19TH>, <Stop 24TH>, , , , , , , , , , , , , , , , , , , , , , , , , , ] sched.routes [, <Route 01>, <Route 02>, <Route 03>, <Route 04>, <Route 05>, <Route 06>, <Route 07>, <Route 08>, <Route 11>, <Route 12>] sched.service_periods [<ServicePeriod WKDY 1111100>, <ServicePeriod SAT 0000010>, <ServicePeriod SUN 0000001>, <ServicePeriod M-FSAT 1111110>, <ServicePeriod SUNAB 0000001>]

pretty much all relationships are mapped

sched.stops[0].stop_times[0].trip.route.agency

sched2 = gtfs.load( "bart.zip", "bart.db" ) # uses a disk-based db instead of a memory db

( this takes just as long as the first time )

sched2 # it's very similar to the first, except ... <gtfs.schedule.Schedule instance at 0xdeadbeef> exit() $ python from gtfs import Schedule sched = Schedule( "bart.db" ) # this takes no time at all sched.stops [, , , , , , , , , , , , , , <Stop 12TH_N>, , <Stop 12TH>, <Stop 16TH>, <Stop 19TH>, <Stop 24TH>, , , , , , , , , , , , , , , , , , , , , , , , , , ] sched.stops[0].stop_times[0].trip.route.agency