Record
Record Class
Represents a statistical record for a player, team, or manufacturer in ESPN's data.
This class extracts and organizes record-related information from the provided JSON data, including general details and associated statistics.
Attributes:
Name | Type | Description |
---|---|---|
espn_instance |
object
|
An instance of the ESPN API client. |
record_json |
dict
|
The raw JSON data containing record details. |
stats |
list
|
A list of Stat objects representing individual statistical entries. |
id |
str or None
|
The unique identifier for the record. |
ref |
str or None
|
The API reference URL for the record. |
name |
str or None
|
The full name of the record. |
abbreviation |
str or None
|
The abbreviated form of the record name. |
display_name |
str or None
|
The display name for the record. |
short_display_name |
str or None
|
The short display name for the record. |
description |
str or None
|
A brief description of the record. |
type |
str or None
|
The type of record (e.g., season record, career record). |
Methods:
Name | Description |
---|---|
_load_record_data |
Extracts and assigns values from record_json to class attributes. |
Source code in pyespn/classes/stat.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
espn_instance
property
PYESPN: the espn client instance associated with the class
__init__(record_json, espn_instance)
Initializes a Record object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
record_json
|
dict
|
The JSON data representing the record. |
required |
espn_instance
|
object
|
An instance of the ESPN API client. |
required |
Source code in pyespn/classes/stat.py
__repr__()
Returns a string representation of the Record instance.
The representation includes the record's display name and abbreviation for easy identification.
Source code in pyespn/classes/stat.py
to_dict()
Converts the Record instance to its original JSON dictionary.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
The records's raw JSON data. |