Example #1
0
from cumtd import CumtdApi
from datetime import datetime

KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

mtd = CumtdApi(KEY, debug=True)

now = datetime.now()

print "Testing GetCalendarDatesByDate"
services = mtd.get_calendar_dates_by_date(now.strftime('%Y-%m-%d'))
print services

print "Testing GetCalendarDatesByService"
print mtd.get_calendar_dates_by_service(services['calendar_dates'][0]['service_id'])

print "Testing GetDeparturesByStop"
print mtd.get_departures_by_stop('GRNWRT')

print "Testing GetRoute"
print mtd.get_route('GREEN')

print "Testing GetRoutes"
print mtd.get_routes()

print "Testing GetShape"
print mtd.get_shape('5E')

print "Testing GetShapeBetweenStops"
print mtd.get_shape_between_stops('GRNNEIL:6', 'IU:1', '5E')