Bet Value
Bet Value Class Documentation
Represents a specific betting value or option within a betting category.
This class dynamically loads all key-value pairs from the given JSON, converting the keys to snake_case and setting them as attributes.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the bet or betting category. |
bet_json |
dict
|
The raw JSON data representing the individual bet value. |
espn_instance |
PYESPN
|
The parent ESPN API wrapper instance. |
(dynamic |
attributes
|
All key-value pairs from |
Source code in pyespn/classes/betting.py
espn_instance
property
PYESPN: the espn client instance associated with the class
__init__(bet_name, bet_json, espn_instance)
Initializes a BetValue instance with the given name and JSON data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bet_name
|
str
|
The name or label for the betting option. |
required |
bet_json
|
dict
|
The raw JSON data for the bet value. |
required |
espn_instance
|
PYESPN
|
The main ESPN API instance. |
required |
Source code in pyespn/classes/betting.py
__repr__()
Returns a string representation of the BetValue instance.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A formatted string identifying the betting value. |
to_dict()
Converts the BetValue instance to its original JSON dictionary.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
The betvalues's raw JSON data. |