Line
Line Class Documentation
Represents a betting line within the ESPN API framework.
This class stores details about a specific betting line, including the associated team or athlete.
Attributes:
Name | Type | Description |
---|---|---|
espn_instance |
PYESPN
|
The ESPN API instance for fetching additional data. |
provider_instance |
Provider
|
The provider offering this betting line. |
book_json |
dict
|
The raw JSON data representing the betting line. |
athlete |
Player or None
|
The athlete associated with the betting line, if applicable. |
team |
Team or None
|
The team associated with the betting line, if applicable. |
ref |
str
|
The API reference URL for the athlete or team. |
value |
float or None
|
The betting odds or value. |
Methods:
Name | Description |
---|---|
_set_line_data |
Parses and stores betting line details. |
__repr__ |
Returns a string representation of the Betting Line instance. |
Source code in pyespn/classes/betting.py
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 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
|
espn_instance
property
PYESPN: the espn client instance associated with the class
__init__(espn_instance, provider_instance, book_json)
Initializes a Line instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
espn_instance
|
PYESPN
|
The ESPN API instance for API interaction. |
required |
provider_instance
|
Provider
|
The betting provider for this line. |
required |
book_json
|
dict
|
The JSON data containing betting line details. |
required |
Source code in pyespn/classes/betting.py
__repr__()
Returns a string representation of the Betting Line instance.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A formatted string with the bettings line information . |
Source code in pyespn/classes/betting.py
to_dict()
Converts the Line instance to its original JSON dictionary.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
The lines's raw JSON data. |