@classmethod
    def fromapi(_class, api, apiresponse):
        bus = apiresponse
        return _class(
            api = api,
            vid = bus['vid'],
            timeupdated = datetime.strptime(bus['tmstmp'], api.STRPTIME),
            lat = float(bus['lat']),
            lng = float(bus['lon']),
            heading = bus['hdg'],
            pid = bus['pid'],
            intotrip = bus['pdist'],
            route = bus['rt'],
            destination = bus['des'],
            speed = bus['spd'],
            delay = bus.get('dly') or False
        )
Return a Bus object from an API response dict.
dataset/ETHPy150Open nhfruchter/pgh-bustime/pghbustime/datatypes.py/Bus.fromapi