Play
Play Class Documentation
Represents a single play within an ESPN sports event.
This class parses and stores data related to an individual play, such as the team involved, score, text descriptions, and various metadata about the play.
Attributes:
Name | Type | Description |
---|---|---|
play_json |
dict
|
Raw JSON data representing the play. |
espn_instance |
PYESPN
|
The parent ESPN API wrapper instance. |
event_instance |
Event
|
The parent event this play belongs to. |
drive_instance |
Drive or None
|
The parent drive (if applicable). |
team |
Team or None
|
The team associated with the play. |
id |
str
|
Unique identifier for the play. |
text |
str
|
Full text description of the play. |
short_text |
str
|
Shortened description of the play. |
alt_text |
str
|
Alternative description of the play. |
short_alt_text |
str
|
Shortened alternative text. |
home_score |
int
|
Score for the home team at this play. |
away_score |
int
|
Score for the away team at this play. |
sequence_number |
int
|
Play's sequence number in the event. |
type |
str
|
Type of the play. |
period |
dict
|
Information about the game period (e.g., quarter, half). |
clock |
dict
|
Game clock status at time of play. |
scoring_play |
bool
|
Whether the play resulted in scoring. |
priority |
int
|
Display priority of the play. |
score_value |
int
|
Amount of points scored on the play. |
start |
dict
|
Start context for the play. |
end |
dict
|
End context for the play. |
wallclock |
str
|
Wallclock timestamp of the play. |
modified |
str
|
Last modification time. |
probability |
dict or None
|
Win probability shift, if present. |
stat_yardage |
int or None
|
Yardage gained or lost (football-specific). |
participants |
list or None
|
Athletes involved in the play. |
shooting_play |
bool or None
|
Whether the play is a shooting play (basketball). |
coordinate |
dict or None
|
X/Y position of the play (if supported). |
Source code in pyespn/classes/gamelog.py
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 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
espn_instance
property
PYESPN: the espn client instance associated with the class
__init__(play_json, espn_instance, event_instance, drive_instance)
Initializes a Play instance using the provided JSON data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
play_json
|
dict
|
The JSON data representing the play. |
required |
espn_instance
|
PYESPN
|
The ESPN API interface instance. |
required |
event_instance
|
Event
|
The event this play belongs to. |
required |
drive_instance
|
Drive or None
|
The drive this play belongs to (if applicable). |
required |
Source code in pyespn/classes/gamelog.py
__repr__()
to_dict()
Converts the Play instance to its original JSON dictionary.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
The plays's raw JSON data. |