Exemplo n.º 1
0
def read_agency_id(agency_id: str):
    data = {}
    cache = cache_json_get('agencies')
    for item in cache:
        if agency_id == item.get('agency_id'):
            data = item
            break
    return {data}
Exemplo n.º 2
0
def read_stop_id(stop_id: str):
    data = {}
    cache = cache_json_get('stops')
    for item in cache:
        if stop_id == item.get('stop_id'):
            data = item
            break
    return {data}
Exemplo n.º 3
0
def read_route_id(route_id: str):
    data = {}
    cache = cache_json_get('routes')
    for item in cache:
        if route_id == item.get('route_id'):
            data = item
            break
    return {data}
Exemplo n.º 4
0
def _get_agency_id(agency_id):
    for agency in cache_json_get('agencies'):
        if agency['agency_id'] == agency_id:
            return agency
Exemplo n.º 5
0
def _get_route_id(route_id):
    for route in cache_json_get('routes'):
        if route['route_id'] == route_id:
            return route
Exemplo n.º 6
0
def read_stops():
    data = cache_json_get('stops')
    return {data}
Exemplo n.º 7
0
def read_agency():
    data = cache_json_get('agencies')
    return {data}
Exemplo n.º 8
0
def read_routes():
    data = cache_json_get('routes')
    return {data}
Exemplo n.º 9
0
def read_vehicles(geobound: GeoBound) -> dict:
    return _api_geobounds(geobound, cache_json_get('vehicles'))