Odds Type
Odds Type Class Documentation
Represents a specific type of betting odds (e.g., open, current, close).
This class parses and stores detailed betting values such as point spread,
spread, and money line. It uses the BetValue
class to wrap individual bet types.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name/type of the odds entry (e.g., "open", "current", "close"). |
odds_type_json |
dict
|
Raw JSON containing the odds data. |
espn_instance |
PYESPN
|
The ESPN API instance used for constructing related data. |
favorite |
str or None
|
The identifier for the favored team in this odds set. |
odds |
dict
|
Dictionary mapping odds types to |
Source code in pyespn/classes/betting.py
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 |
|
espn_instance
property
PYESPN: the espn client instance associated with the class
__init__(odds_name, odds_type_json, espn_instance)
Initializes an OddsType instance with the provided name and JSON data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
odds_name
|
str
|
A label for this odds set (e.g., "open", "current"). |
required |
odds_type_json
|
dict
|
JSON data containing detailed betting values. |
required |
espn_instance
|
PYESPN
|
The parent ESPN API instance. |
required |
Source code in pyespn/classes/betting.py
__repr__()
Returns a string representation of the OddsType instance.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A formatted string indicating the name of the odds type. |
to_dict()
Converts the OddsType instance to its original JSON dictionary.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
The odds type's raw JSON data. |