|
| 1 | +""" |
| 2 | +ScoreboardV2 endpoint for NBA daily game schedule and scores. |
| 3 | +
|
| 4 | +.. deprecated:: 2025-26 |
| 5 | + This endpoint has known issues with line score data for games between |
| 6 | + 2025-10-22 and 2025-12-25. Please use ScoreboardV3 instead. |
| 7 | + ScoreboardV3 is fully backward compatible with all historical seasons. |
| 8 | +""" |
| 9 | +import warnings |
| 10 | + |
1 | 11 | from nba_api.stats.endpoints._base import Endpoint |
2 | 12 | from nba_api.stats.library.http import NBAStatsHTTP |
3 | 13 | from nba_api.stats.library.parameters import DayOffset, GameDate, LeagueID |
4 | 14 |
|
5 | 15 |
|
6 | 16 | class ScoreboardV2(Endpoint): |
| 17 | + """ |
| 18 | + ScoreboardV2 endpoint. |
| 19 | +
|
| 20 | + .. deprecated:: 2025-26 |
| 21 | + **DEPRECATION WARNING:** This endpoint has known issues with line score data. |
| 22 | + Please use :class:`~nba_api.stats.endpoints.ScoreboardV3` instead. |
| 23 | +
|
| 24 | + For 2025-26 season games between October 22, 2025 and December 25, 2025, |
| 25 | + the line_score dataset returns empty despite games being available. |
| 26 | +
|
| 27 | + ScoreboardV3 is fully backward compatible and resolves this issue. |
| 28 | + See: https://github.com/swar/nba_api/issues/596 |
| 29 | +
|
| 30 | + Args: |
| 31 | + day_offset (int, optional): Day offset from game_date. |
| 32 | + game_date (str, optional): Game date in YYYY-MM-DD format. |
| 33 | + league_id (str, optional): League ID ('00' for NBA). |
| 34 | + proxy (str, optional): HTTP/HTTPS proxy for requests. |
| 35 | + headers (dict, optional): Custom HTTP headers. |
| 36 | + timeout (int, optional): Request timeout in seconds. Defaults to 30. |
| 37 | + get_request (bool, optional): Whether to fetch data immediately. Defaults to True. |
| 38 | +
|
| 39 | + Example: |
| 40 | + >>> # Deprecated (has issues with 2025 early season): |
| 41 | + >>> from nba_api.stats.endpoints import ScoreboardV2 |
| 42 | + >>> scoreboard = ScoreboardV2(game_date='2025-10-22') |
| 43 | + >>> |
| 44 | + >>> # Recommended (works for all seasons): |
| 45 | + >>> from nba_api.stats.endpoints import ScoreboardV3 |
| 46 | + >>> scoreboard = ScoreboardV3(game_date='2025-10-22') |
| 47 | + """ |
7 | 48 | endpoint = "scoreboardv2" |
8 | 49 | expected_data = { |
9 | 50 | "Available": ["GAME_ID", "PT_AVAILABLE"], |
@@ -146,6 +187,14 @@ def __init__( |
146 | 187 | timeout=30, |
147 | 188 | get_request=True, |
148 | 189 | ): |
| 190 | + warnings.warn( |
| 191 | + "ScoreboardV2 has known issues with line score data for 2025-26 season games " |
| 192 | + "(October 22 - December 25, 2025). Please use ScoreboardV3 instead. " |
| 193 | + "ScoreboardV3 is fully backward compatible and works for all historical seasons. " |
| 194 | + "See: https://github.com/swar/nba_api/issues/596", |
| 195 | + DeprecationWarning, |
| 196 | + stacklevel=2 |
| 197 | + ) |
149 | 198 | self.proxy = proxy |
150 | 199 | if headers is not None: |
151 | 200 | self.headers = headers |
|
0 commit comments