Beispiel #1
0
    def __init__(self, data):
        status = data['status']

        self.name = parse_encode(status.get('name'))
        self.last_login = datetime_from_iracing_timestamp(
            status.get('lastLogin'))
        self.last_seen = datetime_from_iracing_timestamp(
            status.get('lastSeen'))
        self.broadcast = status.get('broadcast')
        self.driver_changes = status.get('driverChanges')
        self.users_max = status.get('maxUsers')
        self.has_grid = status.get('hasGrid')
        self.private_session = status.get('privateSession')
        self.series_id = status.get('seriesId')
        self.reg_open = status.get('regOpen')
        self.spotter_access = status.get('spotterAccess')
        self.season_id = status.get('seasonId')
        self.helmet = Helmet(status['helmet'])
        self.in_grid = status.get('inGrid')
        self.start_time = status.get('startTime')
        self.subsession_status = status.get('subSessionStatus')
        self.track_id = status.get('trackId')
        self.session_status = status.get('sessionStatus')
        self.session_type_id = status.get('sessionTypeId')
        self.cat_id = status.get('catId')
        self.event_type_id = status.get('eventTypeId')
        self.private_session_id = status.get('privateSessionId')
        self.cust_id = status.get('custid')
        self.user_role = status.get('userRole')
Beispiel #2
0
 def __init__(self, data):
     self.earth_rotation_speedup = data['14']
     self.event_type_id = data['10']
     self.fog_density = data['33']
     self.group_count = data['12']
     self.humidity = data['9']
     self.leave_marbles = data['15']
     self.max_to_display = data['1']
     self.race_week = data['32']
     self.race_week_cars = data['26']
     self.reg_count = data['16']
     self.rubber_practice = data['13']
     self.rubber_qualify = data['24']
     self.rubber_race = data['23']
     self.rubber_warmup = data['20']
     self.season_id = data['31']
     self.session_id = data['7']
     self.skies = data['5']
     self.special_event_type = data['22']
     self.temp_unit = data['19']
     self.temp_value = data['21']
     self.time_of_day = data['27']
     self.time_start = datetime_from_iracing_timestamp(data['6'])
     self.time_start_sim = parse_encode(data['29'])
     self.total_count = data['17']
     self.total_groups = data['30']
     self.track_id = data['3']
     self.weather_initial = data['8']
     self.weather_ongoing = data['25']
     self.weather_type = data['28']
     self.wind_direction = data['11']
     self.wind_speed_unit = data['2']
     self.wind_speed_value = data['4']
Beispiel #3
0
            def __init__(self, data):
                self.earth_rotation_speedup = data['earth_rotation_speedup']
                self.event_type = data['evttype']
                self.fog_density = data['weatherFogDensity']
                self.humidity = data['weatherRelativeHumidity']
                self.race_lap_limit = data['raceLapLimit']
                self.race_time_limit_minutes = data['raceTimeLimitMinutes']
                self.race_week = data['raceWeekNum']
                self.reg_count = data['regCount']
                self.reg_count_pre = data['preRegCount']
                self.session_id = data['sessionID']
                self.session_type_id = data['sessionTypeID']
                self.skies = data['weatherSkies']
                self.special_event_type = data['specialeventtype']
                self.standing_start = data['standingStart']
                self.temp_unit = data['weatherTempUnits']
                self.temp_value = data['weatherTempValue']
                self.time_end = datetime_from_iracing_timestamp(
                    data['endTime'])
                self.time_of_day = data['timeOfDay']
                self.time_start = datetime_from_iracing_timestamp(
                    data['startTime'])
                self.time_start_sim = parse_encode(data['simulatedstarttime'])
                self.track = parse_encode(data['trackName'])
                self.track_config = parse_encode(data['trackConfigName'])
                self.track_id = data['trackID']
                self.track_race_guide_img = parse_encode(
                    data['trackRaceGuideImg'])
                self.weather_initial = data['weatherVarInitial']
                self.weather_ongoing = data['weatherVarOngoing']
                self.weather_type = data['weatherType']
                self.wind_direction = data['weatherWindDir']
                self.wind_speed_unit = data['weatherWindSpeedUnits']
                self.wind_speed_value = data['weatherWindSpeedValue']

                # raceWeekCars returns a dictionary of {weeks} >
                # each week has a dictionary of {car_id} >
                # each car has a dictionary of {car attributes}
                self.race_week_cars = data['raceWeekCars']

                # rubberSettings contains a dictionary of {rubber attributes}
                self.rubber_settings = data['rubberSettings']
Beispiel #4
0
 def __init__(self, data):
     self.car_class_ids = data['carClasses']
     self.fixed_setup = data['fixedSetup']
     self.license_class = data['licenseGroup']
     self.multi_class = data['multiClass']
     self.open_practice_drivers = data['openPracticeDrivers']
     self.open_practice_sessions = data['openPracticeSessions']
     self.race = [self.Race(x) for x in data['races']]
     self.season_id = data['seasonID']
     self.season_start_date = datetime_from_iracing_timestamp(
         data['seasonStartDate'])
Beispiel #5
0
 def __init__(self, data):
     self.active = data.get('active')
     self.cat_id = data.get('catid')
     self.category = data.get('category')
     self.date_end = datetime_from_iracing_timestamp(data.get('end'))
     self.date_start = datetime_from_iracing_timestamp(data.get('start'))
     self.is_lite = data.get('islite')
     self.license_eligible = data.get('licenseEligible')
     self.race_week = data.get('raceweek')
     self.season_id = data.get('seasonid')
     self.season_quarter = data.get('quarter')
     self.season_year = data.get('year')
     self.series_id = data.get('seriesid')
     self.series_lic_group_id = data.get('serieslicgroupid')
     self.series_name_short = parse_encode(data.get('seriesshortname'))
     # Creating subclasses from nested lists
     self.car_classes = [
         self.SeasonCarClass(x) for x in data.get('carclasses', [])
     ]
     self.tracks = [self.Track(x) for x in data.get('tracks', [])]
     self.cars = [self.SeasonCar(x) for x in data.get('cars', [])]
Beispiel #6
0
 def __init__(self, data):
     self.driver_count = data['drivercount']
     self.season_id = data['seasonid']
     self.session_id = data['sessionid']
     self.time_start = datetime_from_iracing_timestamp(data['start_time'])
Beispiel #7
0
 def datetime(self) -> datetime:
     return datetime_from_iracing_timestamp(self.timestamp)