Skip to content

Commit bfe29b5

Browse files
committed
docs: Add deprecation warning to BoxScoreTraditionalV2
Add comprehensive deprecation warning to BoxScoreTraditionalV2 endpoint: - Module-level docstring with deprecation notice - Class docstring with Sphinx deprecation directive - Runtime DeprecationWarning when endpoint is instantiated Users are advised to migrate to BoxScoreTraditionalV3 as data is no longer being published for V2 as of the 2025-26 NBA season.
1 parent 35e1358 commit bfe29b5

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/nba_api/stats/endpoints/boxscoretraditionalv2.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
"""
2+
BoxScoreTraditionalV2 endpoint.
3+
4+
.. deprecated:: 2025-26
5+
This endpoint is deprecated. Please use BoxScoreTraditionalV3 instead.
6+
Data is no longer being published for BoxScoreTraditionalV2 as of the 2025-26 NBA season.
7+
"""
8+
import warnings
9+
110
from nba_api.stats.endpoints._base import Endpoint
211
from nba_api.stats.library.http import NBAStatsHTTP
312
from nba_api.stats.library.parameters import (
@@ -10,6 +19,26 @@
1019

1120

1221
class BoxScoreTraditionalV2(Endpoint):
22+
"""
23+
BoxScoreTraditionalV2 endpoint.
24+
25+
.. deprecated:: 2025-26
26+
**DEPRECATION WARNING:** This endpoint is deprecated.
27+
Please use :class:`~nba_api.stats.endpoints.BoxScoreTraditionalV3` instead.
28+
Data is no longer being published for BoxScoreTraditionalV2 as of the 2025-26 NBA season.
29+
30+
Args:
31+
game_id (str): NBA game ID.
32+
end_period (int, optional): End period for range.
33+
end_range (int, optional): End range value.
34+
range_type (int, optional): Range type parameter.
35+
start_period (int, optional): Start period for range.
36+
start_range (int, optional): Start range value.
37+
proxy (str, optional): HTTP/HTTPS proxy for requests.
38+
headers (dict, optional): Custom HTTP headers.
39+
timeout (int, optional): Request timeout in seconds. Defaults to 30.
40+
get_request (bool, optional): Whether to fetch data immediately. Defaults to True.
41+
"""
1342
endpoint = "boxscoretraditionalv2"
1443
expected_data = {
1544
"PlayerStats": [
@@ -117,6 +146,13 @@ def __init__(
117146
timeout=30,
118147
get_request=True,
119148
):
149+
warnings.warn(
150+
"BoxScoreTraditionalV2 is deprecated and will be removed in a future version. "
151+
"Please use BoxScoreTraditionalV3 instead. "
152+
"Data is no longer being published for BoxScoreTraditionalV2 as of the 2025-26 NBA season.",
153+
DeprecationWarning,
154+
stacklevel=2
155+
)
120156
self.proxy = proxy
121157
if headers is not None:
122158
self.headers = headers

0 commit comments

Comments
 (0)