mrgeorge / BusTripper

Identify bus trips from GPS locations
3 stars 1 forks source link

organize SQL queries to select on day/route/trip/id #2

Closed mrgeorge closed 10 years ago

mrgeorge commented 10 years ago

selectData currently works on date and device_id. device_ids available for a given date can be obtained with selectDevices. dates can be manipulated with datetime and dateutil.parser classes.

import datetime import dateutil.parser

dateiso = "2013-08-01" date = dateutil.parser.parse(dateiso) dt = datetime.timedelta(days=1)

newDate = (date + dt).date().isoformat() # '2013-08-02'

Closing this issue since the remainder (route/trip id) follows #4