code: 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
          )
docs: Return a Bus object from an API response dict.