datasportsapi 0.1.0__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {datasportsapi-0.1.0 → datasportsapi-0.2.0}/PKG-INFO +1 -1
- {datasportsapi-0.1.0 → datasportsapi-0.2.0}/pyproject.toml +1 -1
- {datasportsapi-0.1.0 → datasportsapi-0.2.0}/src/datasportsapi/_resources.py +2 -18
- {datasportsapi-0.1.0 → datasportsapi-0.2.0}/src/datasportsapi/_stream.py +1 -1
- datasportsapi-0.2.0/src/datasportsapi/_version.py +1 -0
- {datasportsapi-0.1.0 → datasportsapi-0.2.0}/src/datasportsapi/types.py +66 -78
- datasportsapi-0.1.0/src/datasportsapi/_version.py +0 -1
- {datasportsapi-0.1.0 → datasportsapi-0.2.0}/.gitignore +0 -0
- {datasportsapi-0.1.0 → datasportsapi-0.2.0}/LICENSE +0 -0
- {datasportsapi-0.1.0 → datasportsapi-0.2.0}/README.md +0 -0
- {datasportsapi-0.1.0 → datasportsapi-0.2.0}/src/datasportsapi/__init__.py +0 -0
- {datasportsapi-0.1.0 → datasportsapi-0.2.0}/src/datasportsapi/_client.py +0 -0
- {datasportsapi-0.1.0 → datasportsapi-0.2.0}/src/datasportsapi/_errors.py +0 -0
- {datasportsapi-0.1.0 → datasportsapi-0.2.0}/src/datasportsapi/_ws.py +0 -0
- {datasportsapi-0.1.0 → datasportsapi-0.2.0}/src/datasportsapi/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: datasportsapi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Official Python client for the DataSportsAPI sports data API: a typed method per endpoint, sync and asyncio, paging, retries and the live WebSocket stream.
|
|
5
5
|
Project-URL: Homepage, https://datasportsapi.com/sdks/python/
|
|
6
6
|
Project-URL: Documentation, https://datasportsapi.com/docs/
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "datasportsapi"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.2.0"
|
|
8
8
|
description = "Official Python client for the DataSportsAPI sports data API: a typed method per endpoint, sync and asyncio, paging, retries and the live WebSocket stream."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -1511,7 +1511,7 @@ class OddsResource(_Resource):
|
|
|
1511
1511
|
|
|
1512
1512
|
|
|
1513
1513
|
class TrackingResource(_Resource):
|
|
1514
|
-
"""Tracking. Enterprise only. These endpoints are the REST side of the tracking data, and the tracking:{id} WebSocket channel sends the same data as live frames. Two rules hold for all of it. Positions follow the coordinate frame named in TrackingSummary.coordinates, and that frame differs by sport. Darts has no coordinates at all; each dart is placed by the bed it landed in. Tennis uses millimetres, with the centre of the net as the origin. Football, basketball and ice hockey use a 0–100 grid on which the home side attacks towards x = 100 for the whole match.
|
|
1514
|
+
"""Tracking. Enterprise only. These endpoints are the REST side of the tracking data, and the tracking:{id} WebSocket channel sends the same data as live frames. Two rules hold for all of it. Positions follow the coordinate frame named in TrackingSummary.coordinates, and that frame differs by sport. Darts has no coordinates at all; each dart is placed by the bed it landed in. Tennis uses millimetres, with the centre of the net as the origin. Football, basketball and ice hockey use a 0–100 grid on which the home side attacks towards x = 100 for the whole match. Baseball has none either: its entries say where the runners stand, not where anyone is. A player named in tracking data is a name from the match squad, without an id. What a match holds depends on its sport. Football: a ball track and events during play (the flow of play, meaning attack, dangerous attack, ball safe and change of possession, and within seconds also goals, shots, cards, substitutions and set pieces), followed after the match by the events with positions and passes. Tennis: the positions of the ball and the players as the match is played, with every serve and point. Basketball and ice hockey: a match timeline with the location of each shot, live since 2026-11-13; basketball has post-match events as well. Darts: a live timeline in which each dart and each visit is an entry (since 2026-11-13). Since 2026-11-24 table tennis and American football have live timelines too: every point in table tennis, which has no coordinates, and every play in American football, placed on a single axis of yards from the home goal line (field). Baseball joined on 2026-11-27 with a pitch-by-pitch timeline. Live positions of the players are not part of the API: only the live match tracker widget draws them. Tracking has been available since 2026-11-12, for matches from 2026-11-07 on.
|
|
1515
1515
|
"""
|
|
1516
1516
|
|
|
1517
1517
|
def get(self, id: int | str) -> t.TrackingGetResponse:
|
|
@@ -1556,14 +1556,6 @@ class TrackingResource(_Resource):
|
|
|
1556
1556
|
"""
|
|
1557
1557
|
return self._client._request("GET", f"/v2/fixtures/{_p(id)}/tracking/timeline", None, None)
|
|
1558
1558
|
|
|
1559
|
-
def players(self, id: int | str, *, after: int | None = None, since: str | None = None, limit: int | None = None, fps: Literal[1, 5] | None = None) -> t.TrackingPlayersResponse:
|
|
1560
|
-
"""Player tracking.
|
|
1561
|
-
|
|
1562
|
-
Plans: enterprise.
|
|
1563
|
-
Docs: https://datasportsapi.com/docs/tracking/players/
|
|
1564
|
-
"""
|
|
1565
|
-
return self._client._request("GET", f"/v2/fixtures/{_p(id)}/tracking/players", {"after": after, "since": since, "limit": limit, "fps": fps}, None)
|
|
1566
|
-
|
|
1567
1559
|
|
|
1568
1560
|
class ExportsResource(_Resource):
|
|
1569
1561
|
"""Season exports. This group turns one league season into downloadable files. The work happens in the background: the create call returns at once, the status call tells you when the build is done, and the finished export carries a download link for each file. The files hold the same data the season’s own endpoints return. An account may start 20 exports per UTC day, and every export is kept for 7 days. The group belongs to the Business and Enterprise plans and respects the plan’s history window: a season that had already ended when the window begins answers 403 history_not_in_plan. The window is 90 days on Business; Enterprise has no limit.
|
|
@@ -3114,7 +3106,7 @@ class AsyncOddsResource(_Resource):
|
|
|
3114
3106
|
|
|
3115
3107
|
|
|
3116
3108
|
class AsyncTrackingResource(_Resource):
|
|
3117
|
-
"""Tracking. Enterprise only. These endpoints are the REST side of the tracking data, and the tracking:{id} WebSocket channel sends the same data as live frames. Two rules hold for all of it. Positions follow the coordinate frame named in TrackingSummary.coordinates, and that frame differs by sport. Darts has no coordinates at all; each dart is placed by the bed it landed in. Tennis uses millimetres, with the centre of the net as the origin. Football, basketball and ice hockey use a 0–100 grid on which the home side attacks towards x = 100 for the whole match.
|
|
3109
|
+
"""Tracking. Enterprise only. These endpoints are the REST side of the tracking data, and the tracking:{id} WebSocket channel sends the same data as live frames. Two rules hold for all of it. Positions follow the coordinate frame named in TrackingSummary.coordinates, and that frame differs by sport. Darts has no coordinates at all; each dart is placed by the bed it landed in. Tennis uses millimetres, with the centre of the net as the origin. Football, basketball and ice hockey use a 0–100 grid on which the home side attacks towards x = 100 for the whole match. Baseball has none either: its entries say where the runners stand, not where anyone is. A player named in tracking data is a name from the match squad, without an id. What a match holds depends on its sport. Football: a ball track and events during play (the flow of play, meaning attack, dangerous attack, ball safe and change of possession, and within seconds also goals, shots, cards, substitutions and set pieces), followed after the match by the events with positions and passes. Tennis: the positions of the ball and the players as the match is played, with every serve and point. Basketball and ice hockey: a match timeline with the location of each shot, live since 2026-11-13; basketball has post-match events as well. Darts: a live timeline in which each dart and each visit is an entry (since 2026-11-13). Since 2026-11-24 table tennis and American football have live timelines too: every point in table tennis, which has no coordinates, and every play in American football, placed on a single axis of yards from the home goal line (field). Baseball joined on 2026-11-27 with a pitch-by-pitch timeline. Live positions of the players are not part of the API: only the live match tracker widget draws them. Tracking has been available since 2026-11-12, for matches from 2026-11-07 on.
|
|
3118
3110
|
|
|
3119
3111
|
The asyncio twin: every method is awaited.
|
|
3120
3112
|
"""
|
|
@@ -3161,14 +3153,6 @@ class AsyncTrackingResource(_Resource):
|
|
|
3161
3153
|
"""
|
|
3162
3154
|
return await self._client._request("GET", f"/v2/fixtures/{_p(id)}/tracking/timeline", None, None)
|
|
3163
3155
|
|
|
3164
|
-
async def players(self, id: int | str, *, after: int | None = None, since: str | None = None, limit: int | None = None, fps: Literal[1, 5] | None = None) -> t.TrackingPlayersResponse:
|
|
3165
|
-
"""Player tracking.
|
|
3166
|
-
|
|
3167
|
-
Plans: enterprise.
|
|
3168
|
-
Docs: https://datasportsapi.com/docs/tracking/players/
|
|
3169
|
-
"""
|
|
3170
|
-
return await self._client._request("GET", f"/v2/fixtures/{_p(id)}/tracking/players", {"after": after, "since": since, "limit": limit, "fps": fps}, None)
|
|
3171
|
-
|
|
3172
3156
|
|
|
3173
3157
|
class AsyncExportsResource(_Resource):
|
|
3174
3158
|
"""Season exports. This group turns one league season into downloadable files. The work happens in the background: the create call returns at once, the status call tells you when the build is done, and the finished export carries a download link for each file. The files hold the same data the season’s own endpoints return. An account may start 20 exports per UTC day, and every export is kept for 7 days. The group belongs to the Business and Enterprise plans and respects the plan’s history window: a season that had already ended when the window begins answers 403 history_not_in_plan. The window is 90 days on Business; Enterprise has no limit.
|
|
@@ -365,7 +365,7 @@ class _StreamIO:
|
|
|
365
365
|
|
|
366
366
|
def _check_seq(self, ws: WebSocket, frame: dict) -> None:
|
|
367
367
|
channel, seq, typ = frame.get("channel"), frame.get("seq"), frame.get("type")
|
|
368
|
-
if not isinstance(channel, str) or not isinstance(seq, int) or isinstance(seq, bool)
|
|
368
|
+
if not isinstance(channel, str) or not isinstance(seq, int) or isinstance(seq, bool):
|
|
369
369
|
return
|
|
370
370
|
resync = False
|
|
371
371
|
with self.lock:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.0"
|
|
@@ -18,6 +18,7 @@ class Fixture(TypedDict):
|
|
|
18
18
|
sport: str
|
|
19
19
|
status: Status
|
|
20
20
|
startTime: str | None
|
|
21
|
+
endTime: str | None
|
|
21
22
|
league: LeagueRef | None
|
|
22
23
|
season: Season | None
|
|
23
24
|
round: Round | None
|
|
@@ -74,8 +75,16 @@ class Fixture(TypedDict):
|
|
|
74
75
|
stale: bool
|
|
75
76
|
awarded: bool | None
|
|
76
77
|
durations: Durations | None
|
|
78
|
+
awayFirst: bool | None
|
|
79
|
+
addedTime: dict[str, float] | None
|
|
77
80
|
lineupsAvailable: bool | None
|
|
78
81
|
lineupsConfirmed: bool | None
|
|
82
|
+
tiesInRound: int | None
|
|
83
|
+
xgAvailable: bool | None
|
|
84
|
+
playerStatisticsAvailable: bool | None
|
|
85
|
+
playerHeatmapAvailable: bool | None
|
|
86
|
+
currentBatterId: int | None
|
|
87
|
+
currentBowlerId: int | None
|
|
79
88
|
|
|
80
89
|
|
|
81
90
|
class FixtureSummary(TypedDict):
|
|
@@ -218,6 +227,7 @@ class FixturePatch(TypedDict, total=False):
|
|
|
218
227
|
downAndDistance: FixturePatchDownAndDistance | None
|
|
219
228
|
varCheck: VarCheck | None
|
|
220
229
|
durations: FixturePatchDurations
|
|
230
|
+
addedTime: dict[str, float | None]
|
|
221
231
|
fightResult: FightResult | None
|
|
222
232
|
homeMembers: list[TeamRef] | None
|
|
223
233
|
awayMembers: list[TeamRef] | None
|
|
@@ -347,6 +357,7 @@ class Person(TypedDict):
|
|
|
347
357
|
prizeMoneySeason: Money | None
|
|
348
358
|
prizeMoneyCareer: Money | None
|
|
349
359
|
fightingStyle: str | None
|
|
360
|
+
underage: bool | None
|
|
350
361
|
|
|
351
362
|
|
|
352
363
|
class LeagueRef(TypedDict):
|
|
@@ -494,6 +505,7 @@ class SquadPlayer(TypedDict):
|
|
|
494
505
|
deceased: bool | None
|
|
495
506
|
previousTeam: TeamRef | None
|
|
496
507
|
joinedOn: str | None
|
|
508
|
+
club: TeamRef | None
|
|
497
509
|
|
|
498
510
|
|
|
499
511
|
class DepthChartEntry(TypedDict):
|
|
@@ -641,6 +653,8 @@ class Incident(TypedDict):
|
|
|
641
653
|
period: PeriodKey | None
|
|
642
654
|
player: PlayerRef | None
|
|
643
655
|
playerName: str | None
|
|
656
|
+
manager: ManagerRef | None
|
|
657
|
+
benchMinute: int | None
|
|
644
658
|
assists: list[PlayerRef]
|
|
645
659
|
assistNames: list[str]
|
|
646
660
|
bodyPart: BodyPart | None
|
|
@@ -1344,6 +1358,8 @@ class ScorecardInnings(TypedDict):
|
|
|
1344
1358
|
bowling: list[ScorecardBowler]
|
|
1345
1359
|
fallOfWickets: list[FallOfWicket]
|
|
1346
1360
|
partnerships: list[Partnership]
|
|
1361
|
+
currentBatter: PlayerRef | None
|
|
1362
|
+
currentBowler: PlayerRef | None
|
|
1347
1363
|
|
|
1348
1364
|
|
|
1349
1365
|
class ScorecardBatter(TypedDict):
|
|
@@ -1439,6 +1455,10 @@ class StandingsRow(TypedDict):
|
|
|
1439
1455
|
averageRating: float | None
|
|
1440
1456
|
noResults: int | None
|
|
1441
1457
|
netRunRate: float | None
|
|
1458
|
+
pointsPerGame: float | None
|
|
1459
|
+
pointsThisSeason: float | None
|
|
1460
|
+
pointsPreviousSeason: float | None
|
|
1461
|
+
pointsTwoSeasonsAgo: float | None
|
|
1442
1462
|
form: list[FormResult] | None
|
|
1443
1463
|
|
|
1444
1464
|
|
|
@@ -1603,6 +1623,7 @@ class PlayerLeagueSeasons(TypedDict):
|
|
|
1603
1623
|
"""A league in which the player has recorded statistics, together with the relevant seasons."""
|
|
1604
1624
|
league: LeagueRef
|
|
1605
1625
|
seasons: list[PlayerLeagueSeasonsSeasonsItem]
|
|
1626
|
+
allTimeSeasonId: int | None
|
|
1606
1627
|
|
|
1607
1628
|
|
|
1608
1629
|
class PlayerLeagueSeasonsSeasonsItem(TypedDict):
|
|
@@ -1636,6 +1657,7 @@ class PlayerFixture(TypedDict):
|
|
|
1636
1657
|
sport: str
|
|
1637
1658
|
status: Status
|
|
1638
1659
|
startTime: str | None
|
|
1660
|
+
endTime: str | None
|
|
1639
1661
|
league: LeagueRef | None
|
|
1640
1662
|
season: Season | None
|
|
1641
1663
|
round: Round | None
|
|
@@ -1692,8 +1714,16 @@ class PlayerFixture(TypedDict):
|
|
|
1692
1714
|
stale: bool
|
|
1693
1715
|
awarded: bool | None
|
|
1694
1716
|
durations: Durations | None
|
|
1717
|
+
awayFirst: bool | None
|
|
1718
|
+
addedTime: dict[str, float] | None
|
|
1695
1719
|
lineupsAvailable: bool | None
|
|
1696
1720
|
lineupsConfirmed: bool | None
|
|
1721
|
+
tiesInRound: int | None
|
|
1722
|
+
xgAvailable: bool | None
|
|
1723
|
+
playerStatisticsAvailable: bool | None
|
|
1724
|
+
playerHeatmapAvailable: bool | None
|
|
1725
|
+
currentBatterId: int | None
|
|
1726
|
+
currentBowlerId: int | None
|
|
1697
1727
|
playerMatch: PlayerMatch | None
|
|
1698
1728
|
|
|
1699
1729
|
|
|
@@ -1737,6 +1767,8 @@ class RankingRow(TypedDict):
|
|
|
1737
1767
|
pointsIfNextWin: float | None
|
|
1738
1768
|
maxPoints: float | None
|
|
1739
1769
|
bestPositionAt: str | None
|
|
1770
|
+
rowName: str | None
|
|
1771
|
+
rankingClass: str | None
|
|
1740
1772
|
|
|
1741
1773
|
|
|
1742
1774
|
class Category(TypedDict):
|
|
@@ -1857,6 +1889,7 @@ class RaceSessionPart(TypedDict):
|
|
|
1857
1889
|
name: str
|
|
1858
1890
|
status: StatusType | None
|
|
1859
1891
|
startTime: str | None
|
|
1892
|
+
round: int | None
|
|
1860
1893
|
|
|
1861
1894
|
|
|
1862
1895
|
class RaceResult(TypedDict):
|
|
@@ -2464,6 +2497,7 @@ class TeamRanking(TypedDict):
|
|
|
2464
2497
|
tournamentsPlayed: int | None
|
|
2465
2498
|
pointsIfNextWin: float | None
|
|
2466
2499
|
maxPoints: float | None
|
|
2500
|
+
rankingClass: str | None
|
|
2467
2501
|
|
|
2468
2502
|
|
|
2469
2503
|
class PlayerOfTheSeason(TypedDict):
|
|
@@ -3129,9 +3163,9 @@ class LiveWireTeam(TypedDict):
|
|
|
3129
3163
|
|
|
3130
3164
|
|
|
3131
3165
|
class TrackingSummary(TypedDict):
|
|
3132
|
-
"""Which tracking data a fixture holds. In football: a ball track and events recorded live (goals, shots, cards, set pieces, the flow of play), completed after the final whistle by the full event list including passes and positions
|
|
3166
|
+
"""Which tracking data a fixture holds. In football: a ball track and events recorded live (goals, shots, cards, set pieces, the flow of play), completed after the final whistle by the full event list including passes and positions, and since 2026-11-23 a timeline recorded live. In tennis: a live ball track and tracked events covering every serve and every point, and since 2026-11-23 a live match timeline. In basketball: a live timeline with shot spots and events read after the match. In ice hockey: a live timeline showing where the shots came from. In darts (since 2026-11-13): a live timeline of every dart and every visit. In table tennis (since 2026-11-24): a live timeline with every point and each game won. In American football (since 2026-11-24): a live timeline of every play with the ball’s spot, down and distance. In baseball (since 2026-11-27): a live timeline of every pitch and play, without positions. History starts on 2026-11-07 for every sport."""
|
|
3133
3167
|
fixtureId: int
|
|
3134
|
-
sport: Literal["football", "tennis", "basketball", "ice-hockey", "darts", "table-tennis", "american-football"]
|
|
3168
|
+
sport: Literal["football", "tennis", "basketball", "ice-hockey", "darts", "table-tennis", "american-football", "baseball"]
|
|
3135
3169
|
coordinates: TrackingCoordinates
|
|
3136
3170
|
final: bool
|
|
3137
3171
|
complete: bool
|
|
@@ -3139,7 +3173,6 @@ class TrackingSummary(TypedDict):
|
|
|
3139
3173
|
ballFrames: int
|
|
3140
3174
|
events: int
|
|
3141
3175
|
timelineEvents: int
|
|
3142
|
-
players: bool
|
|
3143
3176
|
|
|
3144
3177
|
|
|
3145
3178
|
class TrackingSpot(TypedDict):
|
|
@@ -3195,7 +3228,7 @@ class TennisGameScore(TypedDict):
|
|
|
3195
3228
|
|
|
3196
3229
|
|
|
3197
3230
|
class TimelineEvent(TypedDict):
|
|
3198
|
-
"""One entry of a match timeline in basketball, ice hockey or darts, since 2026-11-23 football and tennis,
|
|
3231
|
+
"""One entry of a match timeline in basketball, ice hockey or darts, since 2026-11-23 football and tennis, since 2026-11-24 table tennis and American football, and since 2026-11-27 baseball: shots with where they were taken, saves, penalties, goals, set pieces and periods, and in darts each dart and each visit. Live since 2026-11-13, roughly 5 seconds after the moment (football and tennis about 1–2 seconds; also pushed as timelineEvent frames on tracking:{id}); the source can still revise or withdraw an event afterwards. Events the source withdrew are not included. Football and tennis timelines exist only for matches captured live."""
|
|
3199
3232
|
key: str
|
|
3200
3233
|
type: str
|
|
3201
3234
|
name: str | None
|
|
@@ -3214,6 +3247,7 @@ class TimelineEvent(TypedDict):
|
|
|
3214
3247
|
darts: TimelineDarts | None
|
|
3215
3248
|
tableTennis: TimelineTableTennis | None
|
|
3216
3249
|
americanFootball: TimelineAmericanFootball | None
|
|
3250
|
+
baseball: TimelineBaseball | None
|
|
3217
3251
|
|
|
3218
3252
|
|
|
3219
3253
|
class TimelineDarts(TypedDict):
|
|
@@ -3267,6 +3301,18 @@ class TimelineAmericanFootball(TypedDict):
|
|
|
3267
3301
|
players: list[AmericanFootballPlayer]
|
|
3268
3302
|
|
|
3269
3303
|
|
|
3304
|
+
_TimelineBaseballRequired = TypedDict("_TimelineBaseballRequired", {"balls": "int | None", "strikes": "int | None", "outs": "int | None", "bases": "BaseballBases | None", "from": "int | None", "to": "int | None", "runs": "int | None", "half": "BaseballHalf | None", "kind": "str | None"})
|
|
3305
|
+
class TimelineBaseball(_TimelineBaseballRequired):
|
|
3306
|
+
"""Baseball detail on a timeline entry (since 2026-11-27). The timeline follows the game pitch by pitch and holds no coordinates; each entry says how the count, the outs and the bases stand once it has happened. Anything the event does not concern is left null."""
|
|
3307
|
+
|
|
3308
|
+
|
|
3309
|
+
class BaseballBases(TypedDict):
|
|
3310
|
+
"""The three bases and whether a runner stands on each."""
|
|
3311
|
+
first: bool
|
|
3312
|
+
second: bool
|
|
3313
|
+
third: bool
|
|
3314
|
+
|
|
3315
|
+
|
|
3270
3316
|
class AmericanFootballPlayer(TypedDict):
|
|
3271
3317
|
"""Someone who features in an American football play, given by name and role only; there is no id."""
|
|
3272
3318
|
role: AmericanFootballRole
|
|
@@ -3274,48 +3320,12 @@ class AmericanFootballPlayer(TypedDict):
|
|
|
3274
3320
|
|
|
3275
3321
|
|
|
3276
3322
|
class TrackingSnapshot(TypedDict):
|
|
3277
|
-
"""Snapshot of a tracking:{id} channel: the summary
|
|
3323
|
+
"""Snapshot of a tracking:{id} channel: the summary and the most recent ball frames, tracked events and timeline entries; anything older is available over REST."""
|
|
3278
3324
|
fixtureId: int
|
|
3279
3325
|
tracking: TrackingSummary | None
|
|
3280
3326
|
ball: list[BallFrame]
|
|
3281
3327
|
events: list[TrackedEvent]
|
|
3282
3328
|
timeline: list[TimelineEvent]
|
|
3283
|
-
playerFrame: PlayerFrame | None
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
class PlayerFrame(TypedDict):
|
|
3287
|
-
"""A single player-tracking frame (NBA games from 2026-11-13; Bundesliga, 2. Bundesliga and MLS football from 2026-11-23): the ball and all players on the court or pitch, five frames per second. Positions use the sport’s own frame with home attacking towards x = 100 throughout; the teams change ends at half-time, the frame does not. Which way each team plays is worked out per period: in basketball from where its shots go, so a live frame from the opening seconds, before anyone has shot, may come mirrored (frames read again over REST are corrected); in football from its goalkeeper’s position. No frames are kept for half-time (warm-ups are dropped). Recorded live only: a match that was not captured live has no frames."""
|
|
3288
|
-
frame: int
|
|
3289
|
-
at: str
|
|
3290
|
-
period: int
|
|
3291
|
-
clock: int
|
|
3292
|
-
shotClock: float | None
|
|
3293
|
-
running: bool
|
|
3294
|
-
possession: PlayerFramePossession | None
|
|
3295
|
-
ball: PlayerFrameBall | None
|
|
3296
|
-
players: list[PlayerFramePlayer]
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
class PlayerFramePossession(TypedDict):
|
|
3300
|
-
"""Ball possession within a player frame."""
|
|
3301
|
-
side: Side
|
|
3302
|
-
player: TrackedPlayer | None
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
class PlayerFrameBall(TypedDict):
|
|
3306
|
-
"""Ball position within a player frame."""
|
|
3307
|
-
x: float
|
|
3308
|
-
y: float
|
|
3309
|
-
height: float
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
class PlayerFramePlayer(TypedDict):
|
|
3313
|
-
"""One player on the court or pitch, as seen in a player frame. There is no id, because tracked players are not linked to DataSportsAPI player ids; within one match, name, shirt number and side tell them apart."""
|
|
3314
|
-
side: Side | None
|
|
3315
|
-
name: str | None
|
|
3316
|
-
shirtNumber: int | None
|
|
3317
|
-
x: float
|
|
3318
|
-
y: float
|
|
3319
3329
|
|
|
3320
3330
|
|
|
3321
3331
|
class WsWelcome(TypedDict):
|
|
@@ -3491,7 +3501,7 @@ class WsBall(TypedDict):
|
|
|
3491
3501
|
seq: int
|
|
3492
3502
|
ts: int
|
|
3493
3503
|
id: int
|
|
3494
|
-
sport: Literal["football", "tennis", "basketball", "ice-hockey", "darts", "table-tennis", "american-football"]
|
|
3504
|
+
sport: Literal["football", "tennis", "basketball", "ice-hockey", "darts", "table-tennis", "american-football", "baseball"]
|
|
3495
3505
|
frame: BallFrame
|
|
3496
3506
|
|
|
3497
3507
|
|
|
@@ -3502,7 +3512,7 @@ class WsTrackedEvent(TypedDict):
|
|
|
3502
3512
|
seq: int
|
|
3503
3513
|
ts: int
|
|
3504
3514
|
id: int
|
|
3505
|
-
sport: Literal["football", "tennis", "basketball", "ice-hockey", "darts", "table-tennis", "american-football"]
|
|
3515
|
+
sport: Literal["football", "tennis", "basketball", "ice-hockey", "darts", "table-tennis", "american-football", "baseball"]
|
|
3506
3516
|
event: TrackedEvent
|
|
3507
3517
|
|
|
3508
3518
|
|
|
@@ -3513,22 +3523,12 @@ class WsTimelineEvent(TypedDict):
|
|
|
3513
3523
|
seq: int
|
|
3514
3524
|
ts: int
|
|
3515
3525
|
id: int
|
|
3516
|
-
sport: Literal["football", "tennis", "basketball", "ice-hockey", "darts", "table-tennis", "american-football"]
|
|
3526
|
+
sport: Literal["football", "tennis", "basketball", "ice-hockey", "darts", "table-tennis", "american-football", "baseball"]
|
|
3517
3527
|
op: TimelineOp
|
|
3518
3528
|
key: str
|
|
3519
3529
|
event: TimelineEvent | None
|
|
3520
3530
|
|
|
3521
3531
|
|
|
3522
|
-
class WsPlayerFrame(TypedDict):
|
|
3523
|
-
"""On tracking:{fixtureId}, NBA games only (since 2026-11-13): one player frame with the ball and every player, five per second, about 1–2 seconds behind play and delivered in batches of five each second. Unlike every other frame it has NO seq and is never replayed: it samples the current state and the newest frame wins. Replace the snapshot’s playerFrame with it, and show the frames of one batch in `frame` order, spacing them 0.2 s. A connection that lags behind receives the newer frames and misses the older ones."""
|
|
3524
|
-
type: Literal["playerFrame"]
|
|
3525
|
-
channel: str
|
|
3526
|
-
ts: int
|
|
3527
|
-
id: int
|
|
3528
|
-
sport: Literal["football", "tennis", "basketball", "ice-hockey", "darts", "table-tennis", "american-football"]
|
|
3529
|
-
frame: PlayerFrame
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
3532
|
class WsTrackingStatus(TypedDict):
|
|
3533
3533
|
"""On tracking:{fixtureId} (since 2026-11-12): sent when the match ends (final) and again when its post-match data has been read (complete)."""
|
|
3534
3534
|
type: Literal["trackingStatus"]
|
|
@@ -3536,7 +3536,7 @@ class WsTrackingStatus(TypedDict):
|
|
|
3536
3536
|
seq: int
|
|
3537
3537
|
ts: int
|
|
3538
3538
|
id: int
|
|
3539
|
-
sport: Literal["football", "tennis", "basketball", "ice-hockey", "darts", "table-tennis", "american-football"]
|
|
3539
|
+
sport: Literal["football", "tennis", "basketball", "ice-hockey", "darts", "table-tennis", "american-football", "baseball"]
|
|
3540
3540
|
final: bool
|
|
3541
3541
|
complete: bool
|
|
3542
3542
|
|
|
@@ -3713,7 +3713,7 @@ ShotTechnique: TypeAlias = Literal["wrist", "snap", "slap", "backhand", "tipIn",
|
|
|
3713
3713
|
|
|
3714
3714
|
|
|
3715
3715
|
# Football: the phase of play that produced a shot.
|
|
3716
|
-
ShotSituation: TypeAlias = Literal["regular", "assisted", "corner", "setPiece", "fastBreak", "freeKick", "throwInSetPiece", "penalty", "shootout", "other"]
|
|
3716
|
+
ShotSituation: TypeAlias = Literal["regular", "assisted", "corner", "setPiece", "fastBreak", "freeKick", "throwInSetPiece", "penalty", "shootout", "ownGoal", "other"]
|
|
3717
3717
|
|
|
3718
3718
|
|
|
3719
3719
|
# The type of goal a shot produced.
|
|
@@ -4028,8 +4028,12 @@ AmericanFootballRole: TypeAlias = Literal["passer", "receiver", "target", "rushe
|
|
|
4028
4028
|
TimelineOp: TypeAlias = Literal["upsert", "remove"]
|
|
4029
4029
|
|
|
4030
4030
|
|
|
4031
|
+
# Top or bottom of an inning.
|
|
4032
|
+
BaseballHalf: TypeAlias = Literal["top", "bottom"]
|
|
4033
|
+
|
|
4034
|
+
|
|
4031
4035
|
# Codes that a WebSocket `error` frame can carry.
|
|
4032
|
-
WsErrorCode: TypeAlias = Literal["bad_frame", "unknown_channel", "channel_forbidden", "unknown_league", "unknown_fixture", "unknown_race", "unknown_team", "not_subscribed", "too_many_channels", "snapshot_failed", "rate_limited"]
|
|
4036
|
+
WsErrorCode: TypeAlias = Literal["bad_frame", "unknown_channel", "channel_forbidden", "unknown_league", "unknown_fixture", "unknown_race", "unknown_team", "history_not_in_plan", "not_subscribed", "too_many_channels", "snapshot_failed", "rate_limited"]
|
|
4033
4037
|
|
|
4034
4038
|
|
|
4035
4039
|
# periodN: Regulation period number N. What a period is depends on the sport: a half in football, rugby, handball, futsal, minifootball and bandy; a quarter in basketball, American football, water polo and aussie rules; a period in ice hockey and floorball; a set in tennis, volleyball, table tennis, badminton and padel; an inning in baseball; a round in combat sports; a map / game in esports; a leg / frame block in darts and snooker. inningN: Cricket only: innings number N. extra1: Football and futsal: the opening half of extra time. extra2: Football and futsal: the closing half of extra time. overtime: Every overtime period summed into one value (American football, basketball, handball, ice hockey, water polo, …), as used by scores, status.period and incidents. In baseball it holds the runs scored in extra innings, and only when the source provides no inning-by-inning split (period10, …). overtimeN: Overtime number N, where the source numbers them separately (since 2026-11-23): in match statistics, in play by play and on ice hockey shots. A single overtime is still overtime1, and a basketball game that needs two has overtime1 and overtime2. Scores, status.period and incidents keep the combined `overtime`. penalties: The penalty shoot-out, which appears only as a `status.period` value; its score is kept in ScoreSide.penalties, not under a `periods` key.
|
|
@@ -4640,7 +4644,7 @@ class TeamsTransfersResponse(_TeamsTransfersResponseRequired, total=False):
|
|
|
4640
4644
|
|
|
4641
4645
|
|
|
4642
4646
|
class TeamsTransfersMeta(TypedDict, total=False):
|
|
4643
|
-
"""meta of GET /v2/teams/{id}/transfers: arrivalCount, departureCount."""
|
|
4647
|
+
"""meta of GET /v2/teams/{id}/transfers: arrivalCount, departureCount; historyFrom when your plan's window left older moves out."""
|
|
4644
4648
|
arrivalCount: int
|
|
4645
4649
|
departureCount: int
|
|
4646
4650
|
|
|
@@ -4944,7 +4948,7 @@ class PlayersTransfersResponse(_PlayersTransfersResponseRequired, total=False):
|
|
|
4944
4948
|
|
|
4945
4949
|
|
|
4946
4950
|
class PlayersTransfersMeta(TypedDict, total=False):
|
|
4947
|
-
"""meta of GET /v2/players/{id}/transfers: count."""
|
|
4951
|
+
"""meta of GET /v2/players/{id}/transfers: count; historyFrom when your plan's window left older moves out."""
|
|
4948
4952
|
count: int
|
|
4949
4953
|
|
|
4950
4954
|
|
|
@@ -4958,7 +4962,7 @@ class TransfersListResponse(_TransfersListResponseRequired, total=False):
|
|
|
4958
4962
|
|
|
4959
4963
|
|
|
4960
4964
|
class TransfersListMeta(TypedDict, total=False):
|
|
4961
|
-
"""meta of GET /v2/transfers: sort, league, position, nationality, minAge, maxAge, page, count, hasNextPage."""
|
|
4965
|
+
"""meta of GET /v2/transfers: sort, league, position, nationality, minAge, maxAge, page, count, hasNextPage; historyFrom when your plan's window left older moves out."""
|
|
4962
4966
|
sort: str
|
|
4963
4967
|
league: int | None
|
|
4964
4968
|
position: str | None
|
|
@@ -5400,7 +5404,7 @@ class LeaguesTransfersResponse(_LeaguesTransfersResponseRequired, total=False):
|
|
|
5400
5404
|
|
|
5401
5405
|
|
|
5402
5406
|
class LeaguesTransfersMeta(TypedDict, total=False):
|
|
5403
|
-
"""meta of GET /v2/leagues/{id}/transfers: league, page, count, hasNextPage."""
|
|
5407
|
+
"""meta of GET /v2/leagues/{id}/transfers: league, page, count, hasNextPage; historyFrom when your plan's window left older moves out."""
|
|
5404
5408
|
league: int
|
|
5405
5409
|
page: int
|
|
5406
5410
|
count: int
|
|
@@ -6005,7 +6009,7 @@ class AgenciesTransfersResponse(_AgenciesTransfersResponseRequired, total=False)
|
|
|
6005
6009
|
|
|
6006
6010
|
|
|
6007
6011
|
class AgenciesTransfersMeta(TypedDict, total=False):
|
|
6008
|
-
"""meta of GET /v2/agencies/{id}/transfers: count."""
|
|
6012
|
+
"""meta of GET /v2/agencies/{id}/transfers: count; historyFrom when your plan's window left older moves out."""
|
|
6009
6013
|
count: int
|
|
6010
6014
|
|
|
6011
6015
|
|
|
@@ -6224,22 +6228,6 @@ class TrackingTimelineMeta(TypedDict, total=False):
|
|
|
6224
6228
|
count: int
|
|
6225
6229
|
|
|
6226
6230
|
|
|
6227
|
-
class _TrackingPlayersResponseRequired(TypedDict):
|
|
6228
|
-
data: list[PlayerFrame]
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
class TrackingPlayersResponse(_TrackingPlayersResponseRequired, total=False):
|
|
6232
|
-
"""The answer of GET /v2/fixtures/{id}/tracking/players."""
|
|
6233
|
-
meta: TrackingPlayersMeta
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
class TrackingPlayersMeta(TypedDict, total=False):
|
|
6237
|
-
"""meta of GET /v2/fixtures/{id}/tracking/players: count, hasNextPage, next (the after value for the following page, or null)."""
|
|
6238
|
-
count: int
|
|
6239
|
-
hasNextPage: bool
|
|
6240
|
-
next: int | None
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
6231
|
class ExportsCreateResponse(TypedDict):
|
|
6244
6232
|
"""The answer of POST /v2/exports."""
|
|
6245
6233
|
data: Export
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|