feat: adding openapi spect generation to the frontend client aas well as to fast api. Broke API out into different routes
This commit is contained in:
7
mta_api_client/stop.py
Normal file
7
mta_api_client/stop.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from datetime import datetime
|
||||
from google.transit import gtfs_realtime_pb2
|
||||
from math import trunc
|
||||
|
||||
|
||||
def trip_arrival_in_minutes(stop_time_update: gtfs_realtime_pb2.TripUpdate):
|
||||
return trunc(((datetime.fromtimestamp(stop_time_update.arrival.time) - datetime.now()).total_seconds()) / 60)
|
||||
Reference in New Issue
Block a user