python-ballchasing 0.5.4__py3-none-any.whl → 0.6.0__py3-none-any.whl

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.
@@ -0,0 +1,954 @@
1
+ # Generated by scripts/generate_models.py from tests/data/openapi.json (ballchasing.com API 2026-11).
2
+ # Do not edit: change the generator (or methods.py for methods) and run it again.
3
+ from dataclasses import field
4
+ from datetime import datetime
5
+ from typing import Any, List, Optional
6
+
7
+ from ballchasing.typed._base import _BaseModel, _DictToTypeMixin, model
8
+ from ballchasing.typed.methods import (
9
+ BasePlayerMethods, BaseReplayMethods, BaseTeamMethods, BasicGroupMethods, DeepReplayMethods, PlayerIdMethods,
10
+ RankMethods, ShallowReplayMethods, UserMethods,
11
+ )
12
+
13
+ _new_list = list # For default_factory: in a class with a field named list, list is that field
14
+
15
+
16
+ @model(eq=False)
17
+ class BasicGroup(BasicGroupMethods, _BaseModel, _DictToTypeMixin):
18
+ """
19
+ Fields shared by GroupRef, ShallowGroup, DeepGroup.
20
+ """
21
+ id: str = ""
22
+ name: str = ""
23
+ #: API URL of the group.
24
+ link: str = ""
25
+
26
+
27
+ @model
28
+ class BaseGroup(BasicGroup):
29
+ """
30
+ Fields shared by ShallowGroup, DeepGroup.
31
+ """
32
+ created: Optional[datetime] = None
33
+ player_identification: str = ""
34
+ #: How teams are identified (see `POST /groups`).
35
+ team_identification: str = ""
36
+ #: Whether the group is shared (its replays visible to others through it, whatever their visibility).
37
+ shared: bool = False
38
+
39
+
40
+ @model(repr=False)
41
+ class PlayerId(PlayerIdMethods, _BaseModel, _DictToTypeMixin):
42
+ #: Platform, lower case in `GET /replays` and `GET /replays/{id}`.
43
+ platform: str = ""
44
+ #: The id of the player on the platform.
45
+ id: str = ""
46
+ #: Split-screen player number (absent for the main player).
47
+ player_number: int = 0
48
+
49
+
50
+ @model(eq=False)
51
+ class Rank(RankMethods, _BaseModel, _DictToTypeMixin):
52
+ """
53
+ A Rocket League rank (only set for ranked playlists).
54
+ """
55
+ tier: int = 0
56
+ #: Division, from 1 (absent for ranks without divisions).
57
+ division: int = 0
58
+ name: str = ""
59
+ #: Rank code, as used by the `min-rank` and `max-rank` filters.
60
+ id: str = ""
61
+
62
+
63
+ @model(eq=False)
64
+ class BasePlayer(BasePlayerMethods, _BaseModel, _DictToTypeMixin):
65
+ """
66
+ Fields shared by ReplayPlayer, ReplaySummaryPlayer.
67
+ """
68
+ #: When the player joined, in seconds since the start of the replay.
69
+ start_time: float = 0
70
+ #: When the player left, in seconds since the start of the replay.
71
+ end_time: float = 0
72
+ name: str = ""
73
+ id: Optional[PlayerId] = None
74
+ #: Not sent for full replays (see ReplaySummaryPlayer): always False.
75
+ pro: bool = False
76
+ mvp: bool = False
77
+ rank: Optional[Rank] = None
78
+
79
+
80
+ @model(eq=False)
81
+ class User(UserMethods, _BaseModel, _DictToTypeMixin):
82
+ """
83
+ A ballchasing.com account (a Steam account).
84
+ """
85
+ #: SteamID64 of the account.
86
+ steam_id: str = ""
87
+ #: Steam display name.
88
+ name: str = ""
89
+ #: Steam profile URL.
90
+ profile_url: str = ""
91
+ #: Small avatar URL (empty when unknown).
92
+ avatar: str = ""
93
+ #: Large avatar URL (empty when unknown).
94
+ avatar_full: str = ""
95
+ #: Medium avatar URL (empty when unknown).
96
+ avatar_medium: str = ""
97
+
98
+
99
+ @model(eq=False)
100
+ class GroupRef(BasicGroup):
101
+ pass
102
+
103
+
104
+ @model(eq=False)
105
+ class BaseTeam(BaseTeamMethods, _BaseModel, _DictToTypeMixin):
106
+ """
107
+ Fields shared by ReplayTeam, ReplaySummaryTeam.
108
+ """
109
+ name: str = ""
110
+ players: List[BasePlayer] = field(default_factory=_new_list)
111
+
112
+
113
+ @model(eq=False)
114
+ class BaseReplay(BaseReplayMethods, _BaseModel, _DictToTypeMixin):
115
+ """
116
+ Fields shared by DeepReplay, ShallowReplay.
117
+ """
118
+ id: str = ""
119
+ #: API URL of the replay.
120
+ link: str = ""
121
+ #: The id Rocket League gave the replay.
122
+ rocket_league_id: str = ""
123
+ #: Name of the player who recorded the replay.
124
+ recorder: str = ""
125
+ #: Map code (see `GET /maps`).
126
+ map_code: str = ""
127
+ map_name: str = ""
128
+ playlist_id: str = ""
129
+ playlist_name: str = ""
130
+ #: Duration of the replay, in seconds.
131
+ duration: int = 0
132
+ overtime: bool = False
133
+ overtime_seconds: int = 0
134
+ #: Season number (see `season_type`).
135
+ season: int = 0
136
+ #: `free2play` for the free to play seasons, absent for the old seasons.
137
+ season_type: str = ""
138
+ #: When the game was played.
139
+ date: Optional[datetime] = None
140
+ visibility: str = ""
141
+ #: When the replay was uploaded.
142
+ created: Optional[datetime] = None
143
+ uploader: Optional[User] = None
144
+ min_rank: Optional[Rank] = None
145
+ max_rank: Optional[Rank] = None
146
+ #: The groups of the replay that you can see.
147
+ groups: List[GroupRef] = field(default_factory=_new_list)
148
+ blue: Optional[BaseTeam] = None
149
+ orange: Optional[BaseTeam] = None
150
+
151
+
152
+ @model
153
+ class Camera(_BaseModel, _DictToTypeMixin):
154
+ """
155
+ Camera settings of a player.
156
+ """
157
+ fov: float = 0
158
+ height: float = 0
159
+ pitch: float = 0
160
+ distance: float = 0
161
+ stiffness: float = 0
162
+ swivel_speed: float = 0
163
+ transition_speed: float = 0
164
+
165
+
166
+ @model
167
+ class CoreCounters(_BaseModel, _DictToTypeMixin):
168
+ """
169
+ Counters read as is from the replay file, counted by Rocket League itself. **Omitted** when the replay does not
170
+ track them (replays from before Rocket League's September 2026 update), `0` when it does but the value is zero.
171
+ """
172
+ #: Epic saves.
173
+ epic_saves: float = 0
174
+ #: Clears.
175
+ clears: float = 0
176
+ #: Centers.
177
+ centers: float = 0
178
+ #: Aerial hits.
179
+ aerial_hits: float = 0
180
+ #: Kickoff first touches.
181
+ first_touches: float = 0
182
+ #: Flip resets (as counted by the game, not verified by ballchasing).
183
+ flip_resets: float = 0
184
+ #: Crossbar hits.
185
+ crossbar_hits: float = 0
186
+ #: Bicycle hits.
187
+ bicycle_hits: float = 0
188
+ #: Juggle hits.
189
+ juggle_hits: float = 0
190
+
191
+
192
+ @model
193
+ class GroupPlayer(_BaseModel, _DictToTypeMixin):
194
+ platform: str = ""
195
+ id: str = ""
196
+ name: str = ""
197
+ #: Name of the player's team.
198
+ team: str = ""
199
+
200
+
201
+ @model
202
+ class GroupPlayerCore(CoreCounters):
203
+ """
204
+ Core stats of a player in a group.
205
+ """
206
+ #: Shots taken.
207
+ shots: float = 0
208
+ #: Shots conceded.
209
+ shots_against: float = 0
210
+ #: Goals scored.
211
+ goals: float = 0
212
+ #: Goals conceded.
213
+ goals_against: float = 0
214
+ #: Saves.
215
+ saves: float = 0
216
+ #: Assists.
217
+ assists: float = 0
218
+ #: In-game score.
219
+ score: float = 0
220
+ #: MVPs (total, or per game in `game_average`).
221
+ mvp: float = 0
222
+ #: goals / shots, in percent.
223
+ shooting_percentage: float = 0
224
+
225
+
226
+ @model
227
+ class PlayerBoost(_BaseModel, _DictToTypeMixin):
228
+ """
229
+ Boost stats of a player.
230
+ """
231
+ #: Boost used per minute.
232
+ bpm: float = 0
233
+ #: Boost collected per minute.
234
+ bcpm: float = 0
235
+ #: Average boost amount (0-100).
236
+ avg_amount: float = 0
237
+ #: Boost collected.
238
+ amount_collected: float = 0
239
+ #: Boost collected in the opponent half.
240
+ amount_stolen: float = 0
241
+ #: Boost collected from big pads.
242
+ amount_collected_big: float = 0
243
+ #: Boost stolen from big pads.
244
+ amount_stolen_big: float = 0
245
+ #: Boost collected from small pads.
246
+ amount_collected_small: float = 0
247
+ #: Boost stolen from small pads.
248
+ amount_stolen_small: float = 0
249
+ #: Big pads collected.
250
+ count_collected_big: float = 0
251
+ #: Big pads stolen.
252
+ count_stolen_big: float = 0
253
+ #: Small pads collected.
254
+ count_collected_small: float = 0
255
+ #: Small pads stolen.
256
+ count_stolen_small: float = 0
257
+ #: Boost wasted by collecting pads over 100.
258
+ amount_overfill: float = 0
259
+ #: Boost overfill on stolen pads.
260
+ amount_overfill_stolen: float = 0
261
+ #: Boost used while already supersonic.
262
+ amount_used_while_supersonic: float = 0
263
+ #: Seconds with no boost.
264
+ time_zero_boost: float = 0
265
+ #: Percent of the time with no boost.
266
+ percent_zero_boost: float = 0
267
+ #: Seconds with full boost.
268
+ time_full_boost: float = 0
269
+ #: Percent of the time with full boost.
270
+ percent_full_boost: float = 0
271
+ #: Seconds with 0-25 boost.
272
+ time_boost_0_25: float = 0
273
+ #: Seconds with 25-50 boost.
274
+ time_boost_25_50: float = 0
275
+ #: Seconds with 50-75 boost.
276
+ time_boost_50_75: float = 0
277
+ #: Seconds with 75-100 boost.
278
+ time_boost_75_100: float = 0
279
+ #: Percent of the time with 0-25 boost.
280
+ percent_boost_0_25: float = 0
281
+ #: Percent of the time with 25-50 boost.
282
+ percent_boost_25_50: float = 0
283
+ #: Percent of the time with 50-75 boost.
284
+ percent_boost_50_75: float = 0
285
+ #: Percent of the time with 75-100 boost.
286
+ percent_boost_75_100: float = 0
287
+
288
+
289
+ @model
290
+ class PlayerMovement(_BaseModel, _DictToTypeMixin):
291
+ """
292
+ Movement stats of a player.
293
+ """
294
+ #: Average speed (uu/s).
295
+ avg_speed: float = 0
296
+ #: Distance travelled (uu).
297
+ total_distance: float = 0
298
+ #: Seconds at supersonic speed.
299
+ time_supersonic_speed: float = 0
300
+ #: Seconds at boost speed.
301
+ time_boost_speed: float = 0
302
+ #: Seconds at slow speed.
303
+ time_slow_speed: float = 0
304
+ #: Seconds on the ground.
305
+ time_ground: float = 0
306
+ #: Seconds in low air.
307
+ time_low_air: float = 0
308
+ #: Seconds in high air.
309
+ time_high_air: float = 0
310
+ #: Seconds on the walls (replays processed with repgen 4.0+).
311
+ time_wall: float = 0
312
+ #: Seconds powersliding.
313
+ time_powerslide: float = 0
314
+ #: Powerslides.
315
+ count_powerslide: float = 0
316
+ #: Average powerslide duration (s).
317
+ avg_powerslide_duration: float = 0
318
+ #: Average speed, in percent of the max speed.
319
+ avg_speed_percentage: float = 0
320
+ #: Percent of the time at slow speed.
321
+ percent_slow_speed: float = 0
322
+ #: Percent of the time at boost speed.
323
+ percent_boost_speed: float = 0
324
+ #: Percent of the time at supersonic speed.
325
+ percent_supersonic_speed: float = 0
326
+ #: Percent of the time on the ground.
327
+ percent_ground: float = 0
328
+ #: Percent of the time in low air.
329
+ percent_low_air: float = 0
330
+ #: Percent of the time in high air.
331
+ percent_high_air: float = 0
332
+ #: Percent of the time on the walls.
333
+ percent_wall: float = 0
334
+
335
+
336
+ @model
337
+ class PlayerPositioning(_BaseModel, _DictToTypeMixin):
338
+ """
339
+ Positioning stats of a player. `avg_distance_to_mates` and the `percent_most_*`, `percent_closest_to_ball` and
340
+ `percent_farthest_from_ball` fields are only set in replay stats.
341
+ """
342
+ #: Average distance to the ball (uu).
343
+ avg_distance_to_ball: float = 0
344
+ #: Average distance to the ball while the team has it (uu).
345
+ avg_distance_to_ball_possession: float = 0
346
+ #: Average distance to the ball while the other team has it (uu).
347
+ avg_distance_to_ball_no_possession: float = 0
348
+ #: Average distance to team mates (uu).
349
+ avg_distance_to_mates: float = 0
350
+ #: Seconds in the defensive third.
351
+ time_defensive_third: float = 0
352
+ #: Seconds in the neutral third.
353
+ time_neutral_third: float = 0
354
+ #: Seconds in the offensive third.
355
+ time_offensive_third: float = 0
356
+ #: Seconds in the defensive half.
357
+ time_defensive_half: float = 0
358
+ #: Seconds in the offensive half.
359
+ time_offensive_half: float = 0
360
+ #: Seconds behind the ball.
361
+ time_behind_ball: float = 0
362
+ #: Seconds in front of the ball.
363
+ time_infront_ball: float = 0
364
+ #: Seconds as the most back player.
365
+ time_most_back: float = 0
366
+ #: Seconds as the most forward player.
367
+ time_most_forward: float = 0
368
+ #: Goals conceded while last defender.
369
+ goals_against_while_last_defender: float = 0
370
+ #: Seconds as the closest player to the ball.
371
+ time_closest_to_ball: float = 0
372
+ #: Seconds as the farthest player from the ball.
373
+ time_farthest_from_ball: float = 0
374
+ #: Percent of the time in the defensive third.
375
+ percent_defensive_third: float = 0
376
+ #: Percent of the time in the offensive third.
377
+ percent_offensive_third: float = 0
378
+ #: Percent of the time in the neutral third.
379
+ percent_neutral_third: float = 0
380
+ #: Percent of the time in the defensive half.
381
+ percent_defensive_half: float = 0
382
+ #: Percent of the time in the offensive half.
383
+ percent_offensive_half: float = 0
384
+ #: Percent of the time behind the ball.
385
+ percent_behind_ball: float = 0
386
+ #: Percent of the time in front of the ball.
387
+ percent_infront_ball: float = 0
388
+ #: Percent of the time as the most back player.
389
+ percent_most_back: float = 0
390
+ #: Percent of the time as the most forward player.
391
+ percent_most_forward: float = 0
392
+ #: Percent of the time as the closest player to the ball.
393
+ percent_closest_to_ball: float = 0
394
+ #: Percent of the time as the farthest player from the ball.
395
+ percent_farthest_from_ball: float = 0
396
+
397
+
398
+ @model
399
+ class Demo(_BaseModel, _DictToTypeMixin):
400
+ """
401
+ Demolitions. The `*_in_defensive_half` / `*_in_offensive_half` split is based on the attacker's position; it is
402
+ **omitted** for replays processed before October 2026 (until they are reprocessed).
403
+ """
404
+ #: Demolitions inflicted.
405
+ inflicted: float = 0
406
+ #: Demolitions inflicted while the attacker was in its defensive half.
407
+ inflicted_in_defensive_half: float = 0
408
+ #: Demolitions inflicted while the attacker was in its offensive half.
409
+ inflicted_in_offensive_half: float = 0
410
+ #: Demolitions taken.
411
+ taken: float = 0
412
+ #: Demolitions taken while the attacker was in its defensive half.
413
+ taken_in_defensive_half: float = 0
414
+ #: Demolitions taken while the attacker was in its offensive half.
415
+ taken_in_offensive_half: float = 0
416
+
417
+
418
+ @model
419
+ class GroupPlayerCumulative(_BaseModel, _DictToTypeMixin):
420
+ """
421
+ Totals of a player over the games of the group.
422
+ """
423
+ #: Games played.
424
+ games: int = 0
425
+ #: Games won.
426
+ wins: int = 0
427
+ win_percentage: float = 0
428
+ #: Seconds played.
429
+ play_duration: float = 0
430
+ core: Optional[GroupPlayerCore] = None
431
+ boost: Optional[PlayerBoost] = None
432
+ movement: Optional[PlayerMovement] = None
433
+ positioning: Optional[PlayerPositioning] = None
434
+ demo: Optional[Demo] = None
435
+
436
+
437
+ @model
438
+ class GroupPlayerAverage(_BaseModel, _DictToTypeMixin):
439
+ """
440
+ Per-game averages of a player over the games of the group.
441
+ """
442
+ core: Optional[GroupPlayerCore] = None
443
+ boost: Optional[PlayerBoost] = None
444
+ movement: Optional[PlayerMovement] = None
445
+ positioning: Optional[PlayerPositioning] = None
446
+ demo: Optional[Demo] = None
447
+
448
+
449
+ @model
450
+ class GroupPlayerStats(GroupPlayer):
451
+ """
452
+ A player of the group and its stats.
453
+ """
454
+ cumulative: Optional[GroupPlayerCumulative] = None
455
+ game_average: Optional[GroupPlayerAverage] = None
456
+
457
+
458
+ @model
459
+ class TeamCore(CoreCounters):
460
+ """
461
+ Core stats of a team.
462
+ """
463
+ #: Shots taken.
464
+ shots: float = 0
465
+ #: Shots conceded.
466
+ shots_against: float = 0
467
+ #: Goals scored.
468
+ goals: float = 0
469
+ #: Goals conceded.
470
+ goals_against: float = 0
471
+ #: Saves.
472
+ saves: float = 0
473
+ #: Assists.
474
+ assists: float = 0
475
+ #: In-game score.
476
+ score: float = 0
477
+ #: goals / shots, in percent.
478
+ shooting_percentage: float = 0
479
+
480
+
481
+ @model
482
+ class TeamBoost(_BaseModel, _DictToTypeMixin):
483
+ """
484
+ Boost stats of a team. `bpm`, `bcpm` and `avg_amount` are absent from a group's `cumulative` stats; the
485
+ `percent_*` fields are only set in group stats.
486
+ """
487
+ #: Boost used per minute.
488
+ bpm: float = 0
489
+ #: Boost collected per minute.
490
+ bcpm: float = 0
491
+ #: Average boost amount (0-100).
492
+ avg_amount: float = 0
493
+ #: Boost collected.
494
+ amount_collected: float = 0
495
+ #: Boost collected in the opponent half.
496
+ amount_stolen: float = 0
497
+ #: Boost collected from big pads.
498
+ amount_collected_big: float = 0
499
+ #: Boost stolen from big pads.
500
+ amount_stolen_big: float = 0
501
+ #: Boost collected from small pads.
502
+ amount_collected_small: float = 0
503
+ #: Boost stolen from small pads.
504
+ amount_stolen_small: float = 0
505
+ #: Big pads collected.
506
+ count_collected_big: float = 0
507
+ #: Big pads stolen.
508
+ count_stolen_big: float = 0
509
+ #: Small pads collected.
510
+ count_collected_small: float = 0
511
+ #: Small pads stolen.
512
+ count_stolen_small: float = 0
513
+ #: Boost wasted by collecting pads over 100.
514
+ amount_overfill: float = 0
515
+ #: Boost overfill on stolen pads.
516
+ amount_overfill_stolen: float = 0
517
+ #: Boost used while already supersonic.
518
+ amount_used_while_supersonic: float = 0
519
+ #: Seconds with no boost.
520
+ time_zero_boost: float = 0
521
+ #: Percent of the time with no boost.
522
+ percent_zero_boost: float = 0
523
+ #: Seconds with full boost.
524
+ time_full_boost: float = 0
525
+ #: Percent of the time with full boost.
526
+ percent_full_boost: float = 0
527
+ #: Seconds with 0-25 boost.
528
+ time_boost_0_25: float = 0
529
+ #: Seconds with 25-50 boost.
530
+ time_boost_25_50: float = 0
531
+ #: Seconds with 50-75 boost.
532
+ time_boost_50_75: float = 0
533
+ #: Seconds with 75-100 boost.
534
+ time_boost_75_100: float = 0
535
+
536
+
537
+ @model
538
+ class TeamMovement(_BaseModel, _DictToTypeMixin):
539
+ """
540
+ Movement stats of a team.
541
+ """
542
+ #: Distance travelled (uu).
543
+ total_distance: float = 0
544
+ #: Seconds at supersonic speed.
545
+ time_supersonic_speed: float = 0
546
+ #: Seconds at boost speed.
547
+ time_boost_speed: float = 0
548
+ #: Seconds at slow speed.
549
+ time_slow_speed: float = 0
550
+ #: Seconds on the ground.
551
+ time_ground: float = 0
552
+ #: Seconds in low air.
553
+ time_low_air: float = 0
554
+ #: Seconds in high air.
555
+ time_high_air: float = 0
556
+ #: Seconds on the walls (replays processed with repgen 4.0+).
557
+ time_wall: float = 0
558
+ #: Seconds powersliding.
559
+ time_powerslide: float = 0
560
+ #: Powerslides.
561
+ count_powerslide: float = 0
562
+
563
+
564
+ @model
565
+ class TeamPositioning(_BaseModel, _DictToTypeMixin):
566
+ """
567
+ Positioning stats of a team (the `avg_distance_*` fields only in group stats).
568
+ """
569
+ #: Seconds in the defensive third.
570
+ time_defensive_third: float = 0
571
+ #: Seconds in the neutral third.
572
+ time_neutral_third: float = 0
573
+ #: Seconds in the offensive third.
574
+ time_offensive_third: float = 0
575
+ #: Seconds in the defensive half.
576
+ time_defensive_half: float = 0
577
+ #: Seconds in the offensive half.
578
+ time_offensive_half: float = 0
579
+ #: Seconds behind the ball.
580
+ time_behind_ball: float = 0
581
+ #: Seconds in front of the ball.
582
+ time_infront_ball: float = 0
583
+ #: Average distance to the ball (uu).
584
+ avg_distance_to_ball: float = 0
585
+ #: Average distance to the ball while the team has it (uu).
586
+ avg_distance_to_ball_possession: float = 0
587
+ #: Average distance to the ball while the other team has it (uu).
588
+ avg_distance_to_ball_no_possession: float = 0
589
+
590
+
591
+ @model
592
+ class GroupTeamCumulative(_BaseModel, _DictToTypeMixin):
593
+ """
594
+ Totals of a team over the games of the group.
595
+ """
596
+ #: Games played.
597
+ games: int = 0
598
+ #: Games won.
599
+ wins: int = 0
600
+ win_percentage: float = 0
601
+ #: Seconds played.
602
+ play_duration: float = 0
603
+ core: Optional[TeamCore] = None
604
+ boost: Optional[TeamBoost] = None
605
+ movement: Optional[TeamMovement] = None
606
+ positioning: Optional[TeamPositioning] = None
607
+ demo: Optional[Demo] = None
608
+
609
+
610
+ @model
611
+ class GroupTeamAverage(_BaseModel, _DictToTypeMixin):
612
+ """
613
+ Per-game averages of a team over the games of the group.
614
+ """
615
+ core: Optional[TeamCore] = None
616
+ boost: Optional[TeamBoost] = None
617
+ movement: Optional[TeamMovement] = None
618
+ positioning: Optional[TeamPositioning] = None
619
+ demo: Optional[Demo] = None
620
+
621
+
622
+ @model
623
+ class GroupTeamStats(_BaseModel, _DictToTypeMixin):
624
+ """
625
+ A team of the group and its stats.
626
+ """
627
+ id: str = ""
628
+ name: str = ""
629
+ players: List[GroupPlayer] = field(default_factory=_new_list)
630
+ cumulative: Optional[GroupTeamCumulative] = None
631
+ game_average: Optional[GroupTeamAverage] = None
632
+
633
+
634
+ @model
635
+ class GroupDuplicates(_BaseModel, _DictToTypeMixin):
636
+ """
637
+ Replays of the same game among the group's replays you may see. The same counts whatever `dedup`: only the stats
638
+ change. Which replays they are: `GET /groups/{id}/duplicate-replays`.
639
+ """
640
+ #: The group's replays.
641
+ total_replays: int = 0
642
+ #: `total_replays - unique_games`: the replays of a game already held in another replay.
643
+ duplicate_replays: int = 0
644
+ #: The distinct games among them.
645
+ unique_games: int = 0
646
+
647
+
648
+ @model
649
+ class DeepGroup(BaseGroup):
650
+ """
651
+ A replay group, with the stats of its players and teams.
652
+ """
653
+ status: str = ""
654
+ #: The group's setting: count each game once (`true`) or every replay (`false`). It is the default of the
655
+ #: `dedup` parameter. See "Replays of the same game" above.
656
+ dedup: bool = False
657
+ creator: Optional[User] = None
658
+ #: Ids of the replays that could not be processed (only for the group's owner).
659
+ failed_replays: List[str] = field(default_factory=_new_list)
660
+ players: List[GroupPlayerStats] = field(default_factory=_new_list)
661
+ teams: List[GroupTeamStats] = field(default_factory=_new_list)
662
+ duplicates: Optional[GroupDuplicates] = None
663
+
664
+
665
+ @model
666
+ class PlayerCore(CoreCounters):
667
+ """
668
+ Core stats of a player in a replay.
669
+ """
670
+ #: Shots taken.
671
+ shots: float = 0
672
+ #: Shots conceded.
673
+ shots_against: float = 0
674
+ #: Goals scored.
675
+ goals: float = 0
676
+ #: Goals conceded.
677
+ goals_against: float = 0
678
+ #: Saves.
679
+ saves: float = 0
680
+ #: Assists.
681
+ assists: float = 0
682
+ #: In-game score.
683
+ score: float = 0
684
+ #: Whether the player was the MVP.
685
+ mvp: bool = False
686
+ #: goals / shots, in percent.
687
+ shooting_percentage: float = 0
688
+
689
+
690
+ @model
691
+ class PlayerStats(_BaseModel, _DictToTypeMixin):
692
+ """
693
+ Stats of a player in a replay.
694
+ """
695
+ core: Optional[PlayerCore] = None
696
+ boost: Optional[PlayerBoost] = None
697
+ movement: Optional[PlayerMovement] = None
698
+ positioning: Optional[PlayerPositioning] = None
699
+ demo: Optional[Demo] = None
700
+
701
+
702
+ @model
703
+ class ReplayPlayer(BasePlayer):
704
+ car_id: int = 0
705
+ car_name: str = ""
706
+ camera: Optional[Camera] = None
707
+ steering_sensitivity: float = 0
708
+ link: str = ""
709
+ stats: Optional[PlayerStats] = None
710
+
711
+
712
+ @model
713
+ class TeamBall(_BaseModel, _DictToTypeMixin):
714
+ """
715
+ Ball stats of a team.
716
+ """
717
+ #: Seconds of ball possession.
718
+ possession_time: float = 0
719
+ #: Seconds the ball spent in the team side.
720
+ time_in_side: float = 0
721
+
722
+
723
+ @model
724
+ class TeamStats(_BaseModel, _DictToTypeMixin):
725
+ """
726
+ Stats of a team in a replay.
727
+ """
728
+ ball: Optional[TeamBall] = None
729
+ core: Optional[TeamCore] = None
730
+ boost: Optional[TeamBoost] = None
731
+ movement: Optional[TeamMovement] = None
732
+ positioning: Optional[TeamPositioning] = None
733
+ demo: Optional[Demo] = None
734
+
735
+
736
+ @model
737
+ class ReplayTeam(BaseTeam):
738
+ color: str = ""
739
+ players: List[ReplayPlayer] = field(default_factory=_new_list)
740
+ stats: Optional[TeamStats] = None
741
+
742
+
743
+ @model
744
+ class Server(_BaseModel, _DictToTypeMixin):
745
+ """
746
+ The game server the match was played on, when the replay tells it.
747
+ """
748
+ name: str = ""
749
+ region: str = ""
750
+
751
+
752
+ @model
753
+ class DeepReplay(DeepReplayMethods, BaseReplay):
754
+ """
755
+ A processed replay with its stats.
756
+ """
757
+ status: str = ""
758
+ match_guid: str = ""
759
+ title: str = ""
760
+ match_type: str = ""
761
+ team_size: int = 0
762
+ #: Time actually played, in seconds, without the kickoff countdowns.
763
+ play_duration: int = 0
764
+ #: Whether `date` has a real timezone (old replays only have a local time).
765
+ date_has_timezone: bool = False
766
+ blue: Optional[ReplayTeam] = None
767
+ orange: Optional[ReplayTeam] = None
768
+ server: Optional[Server] = None
769
+
770
+
771
+ @model
772
+ class DuplicateReplay(_BaseModel, _DictToTypeMixin):
773
+ #: A replay of a game already held in another replay of the group.
774
+ replay_id: str = ""
775
+ #: The replay that counts for that game.
776
+ same_game_as: str = ""
777
+
778
+
779
+ @model
780
+ class DuplicateReplayList(_BaseModel, _DictToTypeMixin):
781
+ #: One row per replay not counted when the group counts each game once, sorted by `replay_id`.
782
+ list: List[DuplicateReplay] = field(default_factory=_new_list)
783
+ #: Full URL of the next page, absent on the last page.
784
+ next: str = ""
785
+
786
+
787
+ @model
788
+ class GroupCreated(_BaseModel, _DictToTypeMixin):
789
+ #: The new group's id.
790
+ id: str = ""
791
+ #: API URL of the new group (also in the `Location` header).
792
+ link: str = ""
793
+
794
+
795
+ @model
796
+ class ShallowGroup(BaseGroup):
797
+ """
798
+ A group in a listing (no stats).
799
+ """
800
+ #: Replays directly in the group that you can see.
801
+ direct_replays: int = 0
802
+ #: Replays in its sub-groups (at any depth) that you can see.
803
+ indirect_replays: int = 0
804
+ #: The group's owner.
805
+ user: Optional[User] = None
806
+
807
+
808
+ @model
809
+ class GroupList(_BaseModel, _DictToTypeMixin):
810
+ list: List[ShallowGroup] = field(default_factory=_new_list)
811
+ #: Full URL of the next page, with the same filters: call it as is (with your `Authorization` header). Absent on
812
+ #: the last page.
813
+ next: str = ""
814
+
815
+
816
+ @model
817
+ class GroupUploadToken(_BaseModel, _DictToTypeMixin):
818
+ #: The group upload token, to send as is in the `Authorization` header of `POST /v2/upload`.
819
+ token: str = ""
820
+ #: When the group got its first token.
821
+ created_at: Optional[datetime] = None
822
+ #: When the token was last replaced (absent if it never was).
823
+ updated_at: Optional[datetime] = None
824
+ #: 1 for the first token, incremented each time it is replaced.
825
+ generation: int = 0
826
+
827
+
828
+ @model
829
+ class QuotaPair(_BaseModel, _DictToTypeMixin):
830
+ #: Replays uploaded in the window.
831
+ used: int = 0
832
+ #: Most replays allowed in the window (absent when unlimited).
833
+ max: int = 0
834
+ #: `true` when the window has no limit (`max` is then absent).
835
+ unlimited: bool = False
836
+ #: Set when the uploads could not be counted (`used` is then 0).
837
+ error: str = ""
838
+
839
+
840
+ @model
841
+ class ReplayFileDownloads(_BaseModel, _DictToTypeMixin):
842
+ """
843
+ Downloads of original replay files uploaded by **other accounts**, today (UTC), against the account's daily
844
+ limit (see Download a replay file). One count for the API (`GET /api/replays/{id}/file`), the site's download
845
+ button and group zips together; each replay counts once a day, and the replays the account uploaded never count.
846
+ Once `used` reaches `max`, downloading a replay not downloaded yet today answers 429 until `resets_at`. Reading
847
+ it (pinging) never changes it.
848
+ """
849
+ #: Distinct replays of other accounts downloaded today (UTC). Can be above `max` after the account's tier went
850
+ #: down during the day.
851
+ used: int = 0
852
+ #: The account's daily limit (absent when unlimited).
853
+ max: int = 0
854
+ #: `true` when the account has no daily limit (`max` is then absent).
855
+ unlimited: bool = False
856
+ #: When the count restarts at 0 (the next midnight UTC), RFC 3339.
857
+ resets_at: Optional[datetime] = None
858
+ #: Set when the count could not be read (`used` is then 0).
859
+ error: str = ""
860
+
861
+
862
+ @model
863
+ class PingQuota(_BaseModel, _DictToTypeMixin):
864
+ """
865
+ The quotas of the account: replays uploaded in the last 24 hours and 7 days, and the maximum of each window;
866
+ original replay files of other accounts downloaded today (UTC), and the daily limit.
867
+ """
868
+ uploads_in_24h: Optional[QuotaPair] = None
869
+ uploads_in_7d: Optional[QuotaPair] = None
870
+ replay_file_downloads: Optional[ReplayFileDownloads] = None
871
+
872
+
873
+ @model
874
+ class Ping(_BaseModel, _DictToTypeMixin):
875
+ chaser: bool = False
876
+ boost: str = ""
877
+ ball: str = ""
878
+ chat: Optional[dict] = None
879
+ #: Steam name of the API key's owner.
880
+ name: str = ""
881
+ #: SteamID64 of the API key's owner.
882
+ steam_id: str = ""
883
+ #: The kind of account behind the key, the first that applies: `admin`, `org` (approved organisation account),
884
+ #: `bot` (approved bot account), its Patreon tier (`gold`, `diamond`, `champion`, `gc`, `legend`), else
885
+ #: `regular`.
886
+ type: str = ""
887
+ #: The quotas of the account: replays uploaded in the last 24 hours and 7 days, and the maximum of each window;
888
+ #: original replay files of other accounts downloaded today (UTC), and the daily limit.
889
+ quota: Optional[PingQuota] = None
890
+
891
+
892
+ @model
893
+ class ReplayBase(_BaseModel, _DictToTypeMixin):
894
+ """
895
+ What every replay response has, whatever its processing status.
896
+ """
897
+ id: str = ""
898
+ #: API URL of the replay.
899
+ link: str = ""
900
+ #: When the replay was uploaded.
901
+ created: Optional[datetime] = None
902
+ uploader: Optional[User] = None
903
+ #: `ok`: processed, all the fields are set; `pending`: not processed yet: retry later; `failed`: the replay file
904
+ #: could not be processed
905
+ status: str = ""
906
+
907
+
908
+ @model
909
+ class ReplaySummaryPlayer(BasePlayer):
910
+ score: int = 0
911
+ liquipedia_roles: List[str] = field(default_factory=_new_list)
912
+
913
+
914
+ @model(eq=False)
915
+ class ReplaySummaryTeam(BaseTeam):
916
+ goals: int = 0
917
+ players: List[ReplaySummaryPlayer] = field(default_factory=_new_list)
918
+
919
+
920
+ @model
921
+ class ShallowReplay(ShallowReplayMethods, BaseReplay):
922
+ """
923
+ A replay in a listing (no stats).
924
+ """
925
+ replay_title: str = ""
926
+ date_has_tz: bool = False
927
+ blue: Optional[ReplaySummaryTeam] = None
928
+ orange: Optional[ReplaySummaryTeam] = None
929
+
930
+
931
+ @model
932
+ class ReplayList(_BaseModel, _DictToTypeMixin):
933
+ #: Total number of replays matching the filters (all pages), counted up to 10,000 (more reads 10000). Absent
934
+ #: when no replay matches.
935
+ count: int = 0
936
+ list: List[ShallowReplay] = field(default_factory=_new_list)
937
+ #: Full URL of the next page, with the same filters: call it as is (with your `Authorization` header). Absent on
938
+ #: the last page.
939
+ next: str = ""
940
+
941
+
942
+ @model
943
+ class ReplayPending(ReplayBase):
944
+ """
945
+ A replay that is not processed (yet): only the metadata is available.
946
+ """
947
+
948
+
949
+ @model
950
+ class UploadCreated(_BaseModel, _DictToTypeMixin):
951
+ #: The id of the created replay.
952
+ id: str = ""
953
+ #: The replay's page on ballchasing.com (also in the `Location` header).
954
+ location: str = ""