cbbd 1.1.0a1__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- cbbd/__init__.py +64 -0
- cbbd/api/__init__.py +10 -0
- cbbd/api/conferences_api.py +176 -0
- cbbd/api/games_api.py +806 -0
- cbbd/api/plays_api.py +761 -0
- cbbd/api/stats_api.py +423 -0
- cbbd/api/teams_api.py +195 -0
- cbbd/api/venues_api.py +176 -0
- cbbd/api_client.py +767 -0
- cbbd/api_response.py +25 -0
- cbbd/configuration.py +443 -0
- cbbd/exceptions.py +167 -0
- cbbd/models/__init__.py +42 -0
- cbbd/models/conference_info.py +80 -0
- cbbd/models/game_box_score_players.py +147 -0
- cbbd/models/game_box_score_players_players_inner.py +238 -0
- cbbd/models/game_box_score_team.py +148 -0
- cbbd/models/game_box_score_team_stats.py +170 -0
- cbbd/models/game_box_score_team_stats_points.py +112 -0
- cbbd/models/game_info.py +212 -0
- cbbd/models/game_media_info.py +133 -0
- cbbd/models/game_media_info_broadcasts_inner.py +74 -0
- cbbd/models/game_status.py +44 -0
- cbbd/models/play_info.py +193 -0
- cbbd/models/play_info_participants_inner.py +74 -0
- cbbd/models/play_type_info.py +74 -0
- cbbd/models/player_season_stats.py +231 -0
- cbbd/models/season_type.py +42 -0
- cbbd/models/team_info.py +160 -0
- cbbd/models/team_season_stats.py +112 -0
- cbbd/models/team_season_unit_stats.py +163 -0
- cbbd/models/team_season_unit_stats_field_goals.py +91 -0
- cbbd/models/team_season_unit_stats_fouls.py +91 -0
- cbbd/models/team_season_unit_stats_four_factors.py +98 -0
- cbbd/models/team_season_unit_stats_points.py +98 -0
- cbbd/models/team_season_unit_stats_rebounds.py +91 -0
- cbbd/models/team_season_unit_stats_turnovers.py +84 -0
- cbbd/models/venue_info.py +102 -0
- cbbd/py.typed +0 -0
- cbbd/rest.py +330 -0
- cbbd-1.1.0a1.dist-info/METADATA +24 -0
- cbbd-1.1.0a1.dist-info/RECORD +44 -0
- cbbd-1.1.0a1.dist-info/WHEEL +5 -0
- cbbd-1.1.0a1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,80 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
College Basketball Data API
|
5
|
+
|
6
|
+
This API is in limited Beta for Patreon subscribers. It may have bugs and is subject to changes. API keys can be acquired from the CollegeFootballData.com website.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.1.0
|
9
|
+
Contact: admin@collegefootballdata.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
from pydantic import BaseModel, Field, StrictInt, StrictStr
|
24
|
+
|
25
|
+
class ConferenceInfo(BaseModel):
|
26
|
+
"""
|
27
|
+
ConferenceInfo
|
28
|
+
"""
|
29
|
+
id: StrictInt = Field(...)
|
30
|
+
source_id: StrictStr = Field(default=..., alias="sourceId")
|
31
|
+
name: StrictStr = Field(...)
|
32
|
+
abbreviation: StrictStr = Field(...)
|
33
|
+
short_name: StrictStr = Field(default=..., alias="shortName")
|
34
|
+
__properties = ["id", "sourceId", "name", "abbreviation", "shortName"]
|
35
|
+
|
36
|
+
class Config:
|
37
|
+
"""Pydantic configuration"""
|
38
|
+
allow_population_by_field_name = True
|
39
|
+
validate_assignment = True
|
40
|
+
|
41
|
+
def to_str(self) -> str:
|
42
|
+
"""Returns the string representation of the model using alias"""
|
43
|
+
return pprint.pformat(self.dict(by_alias=True))
|
44
|
+
|
45
|
+
def to_json(self) -> str:
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
47
|
+
return json.dumps(self.to_dict())
|
48
|
+
|
49
|
+
@classmethod
|
50
|
+
def from_json(cls, json_str: str) -> ConferenceInfo:
|
51
|
+
"""Create an instance of ConferenceInfo from a JSON string"""
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
53
|
+
|
54
|
+
def to_dict(self):
|
55
|
+
"""Returns the dictionary representation of the model using alias"""
|
56
|
+
_dict = self.dict(by_alias=True,
|
57
|
+
exclude={
|
58
|
+
},
|
59
|
+
exclude_none=True)
|
60
|
+
return _dict
|
61
|
+
|
62
|
+
@classmethod
|
63
|
+
def from_dict(cls, obj: dict) -> ConferenceInfo:
|
64
|
+
"""Create an instance of ConferenceInfo from a dict"""
|
65
|
+
if obj is None:
|
66
|
+
return None
|
67
|
+
|
68
|
+
if not isinstance(obj, dict):
|
69
|
+
return ConferenceInfo.parse_obj(obj)
|
70
|
+
|
71
|
+
_obj = ConferenceInfo.parse_obj({
|
72
|
+
"id": obj.get("id"),
|
73
|
+
"source_id": obj.get("sourceId"),
|
74
|
+
"name": obj.get("name"),
|
75
|
+
"abbreviation": obj.get("abbreviation"),
|
76
|
+
"short_name": obj.get("shortName")
|
77
|
+
})
|
78
|
+
return _obj
|
79
|
+
|
80
|
+
|
@@ -0,0 +1,147 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
College Basketball Data API
|
5
|
+
|
6
|
+
This API is in limited Beta for Patreon subscribers. It may have bugs and is subject to changes. API keys can be acquired from the CollegeFootballData.com website.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.1.0
|
9
|
+
Contact: admin@collegefootballdata.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from datetime import datetime
|
22
|
+
from typing import List, Optional, Union
|
23
|
+
from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist
|
24
|
+
from cbbd.models.game_box_score_players_players_inner import GameBoxScorePlayersPlayersInner
|
25
|
+
from cbbd.models.season_type import SeasonType
|
26
|
+
|
27
|
+
class GameBoxScorePlayers(BaseModel):
|
28
|
+
"""
|
29
|
+
GameBoxScorePlayers
|
30
|
+
"""
|
31
|
+
game_id: StrictInt = Field(default=..., alias="gameId")
|
32
|
+
season: StrictInt = Field(...)
|
33
|
+
season_label: StrictStr = Field(default=..., alias="seasonLabel")
|
34
|
+
season_type: SeasonType = Field(default=..., alias="seasonType")
|
35
|
+
start_date: datetime = Field(default=..., alias="startDate")
|
36
|
+
start_time_tbd: StrictBool = Field(default=..., alias="startTimeTbd")
|
37
|
+
team_id: StrictInt = Field(default=..., alias="teamId")
|
38
|
+
team: StrictStr = Field(...)
|
39
|
+
conference: Optional[StrictStr] = Field(...)
|
40
|
+
opponent_id: StrictInt = Field(default=..., alias="opponentId")
|
41
|
+
opponent: StrictStr = Field(...)
|
42
|
+
opponent_conference: Optional[StrictStr] = Field(default=..., alias="opponentConference")
|
43
|
+
neutral_site: StrictBool = Field(default=..., alias="neutralSite")
|
44
|
+
conference_game: StrictBool = Field(default=..., alias="conferenceGame")
|
45
|
+
game_type: Optional[StrictStr] = Field(default=..., alias="gameType")
|
46
|
+
notes: Optional[StrictStr] = Field(...)
|
47
|
+
game_minutes: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="gameMinutes")
|
48
|
+
game_pace: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="gamePace")
|
49
|
+
players: conlist(GameBoxScorePlayersPlayersInner) = Field(...)
|
50
|
+
__properties = ["gameId", "season", "seasonLabel", "seasonType", "startDate", "startTimeTbd", "teamId", "team", "conference", "opponentId", "opponent", "opponentConference", "neutralSite", "conferenceGame", "gameType", "notes", "gameMinutes", "gamePace", "players"]
|
51
|
+
|
52
|
+
class Config:
|
53
|
+
"""Pydantic configuration"""
|
54
|
+
allow_population_by_field_name = True
|
55
|
+
validate_assignment = True
|
56
|
+
|
57
|
+
def to_str(self) -> str:
|
58
|
+
"""Returns the string representation of the model using alias"""
|
59
|
+
return pprint.pformat(self.dict(by_alias=True))
|
60
|
+
|
61
|
+
def to_json(self) -> str:
|
62
|
+
"""Returns the JSON representation of the model using alias"""
|
63
|
+
return json.dumps(self.to_dict())
|
64
|
+
|
65
|
+
@classmethod
|
66
|
+
def from_json(cls, json_str: str) -> GameBoxScorePlayers:
|
67
|
+
"""Create an instance of GameBoxScorePlayers from a JSON string"""
|
68
|
+
return cls.from_dict(json.loads(json_str))
|
69
|
+
|
70
|
+
def to_dict(self):
|
71
|
+
"""Returns the dictionary representation of the model using alias"""
|
72
|
+
_dict = self.dict(by_alias=True,
|
73
|
+
exclude={
|
74
|
+
},
|
75
|
+
exclude_none=True)
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of each item in players (list)
|
77
|
+
_items = []
|
78
|
+
if self.players:
|
79
|
+
for _item in self.players:
|
80
|
+
if _item:
|
81
|
+
_items.append(_item.to_dict())
|
82
|
+
_dict['players'] = _items
|
83
|
+
# set to None if conference (nullable) is None
|
84
|
+
# and __fields_set__ contains the field
|
85
|
+
if self.conference is None and "conference" in self.__fields_set__:
|
86
|
+
_dict['conference'] = None
|
87
|
+
|
88
|
+
# set to None if opponent_conference (nullable) is None
|
89
|
+
# and __fields_set__ contains the field
|
90
|
+
if self.opponent_conference is None and "opponent_conference" in self.__fields_set__:
|
91
|
+
_dict['opponentConference'] = None
|
92
|
+
|
93
|
+
# set to None if game_type (nullable) is None
|
94
|
+
# and __fields_set__ contains the field
|
95
|
+
if self.game_type is None and "game_type" in self.__fields_set__:
|
96
|
+
_dict['gameType'] = None
|
97
|
+
|
98
|
+
# set to None if notes (nullable) is None
|
99
|
+
# and __fields_set__ contains the field
|
100
|
+
if self.notes is None and "notes" in self.__fields_set__:
|
101
|
+
_dict['notes'] = None
|
102
|
+
|
103
|
+
# set to None if game_minutes (nullable) is None
|
104
|
+
# and __fields_set__ contains the field
|
105
|
+
if self.game_minutes is None and "game_minutes" in self.__fields_set__:
|
106
|
+
_dict['gameMinutes'] = None
|
107
|
+
|
108
|
+
# set to None if game_pace (nullable) is None
|
109
|
+
# and __fields_set__ contains the field
|
110
|
+
if self.game_pace is None and "game_pace" in self.__fields_set__:
|
111
|
+
_dict['gamePace'] = None
|
112
|
+
|
113
|
+
return _dict
|
114
|
+
|
115
|
+
@classmethod
|
116
|
+
def from_dict(cls, obj: dict) -> GameBoxScorePlayers:
|
117
|
+
"""Create an instance of GameBoxScorePlayers from a dict"""
|
118
|
+
if obj is None:
|
119
|
+
return None
|
120
|
+
|
121
|
+
if not isinstance(obj, dict):
|
122
|
+
return GameBoxScorePlayers.parse_obj(obj)
|
123
|
+
|
124
|
+
_obj = GameBoxScorePlayers.parse_obj({
|
125
|
+
"game_id": obj.get("gameId"),
|
126
|
+
"season": obj.get("season"),
|
127
|
+
"season_label": obj.get("seasonLabel"),
|
128
|
+
"season_type": obj.get("seasonType"),
|
129
|
+
"start_date": obj.get("startDate"),
|
130
|
+
"start_time_tbd": obj.get("startTimeTbd"),
|
131
|
+
"team_id": obj.get("teamId"),
|
132
|
+
"team": obj.get("team"),
|
133
|
+
"conference": obj.get("conference"),
|
134
|
+
"opponent_id": obj.get("opponentId"),
|
135
|
+
"opponent": obj.get("opponent"),
|
136
|
+
"opponent_conference": obj.get("opponentConference"),
|
137
|
+
"neutral_site": obj.get("neutralSite"),
|
138
|
+
"conference_game": obj.get("conferenceGame"),
|
139
|
+
"game_type": obj.get("gameType"),
|
140
|
+
"notes": obj.get("notes"),
|
141
|
+
"game_minutes": obj.get("gameMinutes"),
|
142
|
+
"game_pace": obj.get("gamePace"),
|
143
|
+
"players": [GameBoxScorePlayersPlayersInner.from_dict(_item) for _item in obj.get("players")] if obj.get("players") is not None else None
|
144
|
+
})
|
145
|
+
return _obj
|
146
|
+
|
147
|
+
|
@@ -0,0 +1,238 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
College Basketball Data API
|
5
|
+
|
6
|
+
This API is in limited Beta for Patreon subscribers. It may have bugs and is subject to changes. API keys can be acquired from the CollegeFootballData.com website.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.1.0
|
9
|
+
Contact: admin@collegefootballdata.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
|
22
|
+
from typing import Optional, Union
|
23
|
+
from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr
|
24
|
+
from cbbd.models.team_season_unit_stats_field_goals import TeamSeasonUnitStatsFieldGoals
|
25
|
+
from cbbd.models.team_season_unit_stats_rebounds import TeamSeasonUnitStatsRebounds
|
26
|
+
|
27
|
+
class GameBoxScorePlayersPlayersInner(BaseModel):
|
28
|
+
"""
|
29
|
+
GameBoxScorePlayersPlayersInner
|
30
|
+
"""
|
31
|
+
rebounds: TeamSeasonUnitStatsRebounds = Field(...)
|
32
|
+
free_throws: TeamSeasonUnitStatsFieldGoals = Field(default=..., alias="freeThrows")
|
33
|
+
three_point_field_goals: TeamSeasonUnitStatsFieldGoals = Field(default=..., alias="threePointFieldGoals")
|
34
|
+
two_point_field_goals: TeamSeasonUnitStatsFieldGoals = Field(default=..., alias="twoPointFieldGoals")
|
35
|
+
field_goals: TeamSeasonUnitStatsFieldGoals = Field(default=..., alias="fieldGoals")
|
36
|
+
offensive_rebound_pct: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="offensiveReboundPct")
|
37
|
+
free_throw_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="freeThrowRate")
|
38
|
+
assists_turnover_ratio: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="assistsTurnoverRatio")
|
39
|
+
game_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="gameScore")
|
40
|
+
true_shooting_pct: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="trueShootingPct")
|
41
|
+
effective_field_goal_pct: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="effectiveFieldGoalPct")
|
42
|
+
net_rating: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="netRating")
|
43
|
+
defensive_rating: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="defensiveRating")
|
44
|
+
offensive_rating: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="offensiveRating")
|
45
|
+
usage: Optional[Union[StrictFloat, StrictInt]] = Field(...)
|
46
|
+
blocks: Optional[Union[StrictFloat, StrictInt]] = Field(...)
|
47
|
+
steals: Optional[Union[StrictFloat, StrictInt]] = Field(...)
|
48
|
+
assists: Optional[Union[StrictFloat, StrictInt]] = Field(...)
|
49
|
+
fouls: Optional[Union[StrictFloat, StrictInt]] = Field(...)
|
50
|
+
turnovers: Optional[Union[StrictFloat, StrictInt]] = Field(...)
|
51
|
+
points: Optional[Union[StrictFloat, StrictInt]] = Field(...)
|
52
|
+
minutes: Optional[Union[StrictFloat, StrictInt]] = Field(...)
|
53
|
+
ejected: Optional[StrictBool] = Field(...)
|
54
|
+
starter: Optional[StrictBool] = Field(...)
|
55
|
+
position: StrictStr = Field(...)
|
56
|
+
name: StrictStr = Field(...)
|
57
|
+
athlete_source_id: StrictStr = Field(default=..., alias="athleteSourceId")
|
58
|
+
athlete_id: StrictInt = Field(default=..., alias="athleteId")
|
59
|
+
__properties = ["rebounds", "freeThrows", "threePointFieldGoals", "twoPointFieldGoals", "fieldGoals", "offensiveReboundPct", "freeThrowRate", "assistsTurnoverRatio", "gameScore", "trueShootingPct", "effectiveFieldGoalPct", "netRating", "defensiveRating", "offensiveRating", "usage", "blocks", "steals", "assists", "fouls", "turnovers", "points", "minutes", "ejected", "starter", "position", "name", "athleteSourceId", "athleteId"]
|
60
|
+
|
61
|
+
class Config:
|
62
|
+
"""Pydantic configuration"""
|
63
|
+
allow_population_by_field_name = True
|
64
|
+
validate_assignment = True
|
65
|
+
|
66
|
+
def to_str(self) -> str:
|
67
|
+
"""Returns the string representation of the model using alias"""
|
68
|
+
return pprint.pformat(self.dict(by_alias=True))
|
69
|
+
|
70
|
+
def to_json(self) -> str:
|
71
|
+
"""Returns the JSON representation of the model using alias"""
|
72
|
+
return json.dumps(self.to_dict())
|
73
|
+
|
74
|
+
@classmethod
|
75
|
+
def from_json(cls, json_str: str) -> GameBoxScorePlayersPlayersInner:
|
76
|
+
"""Create an instance of GameBoxScorePlayersPlayersInner from a JSON string"""
|
77
|
+
return cls.from_dict(json.loads(json_str))
|
78
|
+
|
79
|
+
def to_dict(self):
|
80
|
+
"""Returns the dictionary representation of the model using alias"""
|
81
|
+
_dict = self.dict(by_alias=True,
|
82
|
+
exclude={
|
83
|
+
},
|
84
|
+
exclude_none=True)
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of rebounds
|
86
|
+
if self.rebounds:
|
87
|
+
_dict['rebounds'] = self.rebounds.to_dict()
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of free_throws
|
89
|
+
if self.free_throws:
|
90
|
+
_dict['freeThrows'] = self.free_throws.to_dict()
|
91
|
+
# override the default output from pydantic by calling `to_dict()` of three_point_field_goals
|
92
|
+
if self.three_point_field_goals:
|
93
|
+
_dict['threePointFieldGoals'] = self.three_point_field_goals.to_dict()
|
94
|
+
# override the default output from pydantic by calling `to_dict()` of two_point_field_goals
|
95
|
+
if self.two_point_field_goals:
|
96
|
+
_dict['twoPointFieldGoals'] = self.two_point_field_goals.to_dict()
|
97
|
+
# override the default output from pydantic by calling `to_dict()` of field_goals
|
98
|
+
if self.field_goals:
|
99
|
+
_dict['fieldGoals'] = self.field_goals.to_dict()
|
100
|
+
# set to None if offensive_rebound_pct (nullable) is None
|
101
|
+
# and __fields_set__ contains the field
|
102
|
+
if self.offensive_rebound_pct is None and "offensive_rebound_pct" in self.__fields_set__:
|
103
|
+
_dict['offensiveReboundPct'] = None
|
104
|
+
|
105
|
+
# set to None if free_throw_rate (nullable) is None
|
106
|
+
# and __fields_set__ contains the field
|
107
|
+
if self.free_throw_rate is None and "free_throw_rate" in self.__fields_set__:
|
108
|
+
_dict['freeThrowRate'] = None
|
109
|
+
|
110
|
+
# set to None if assists_turnover_ratio (nullable) is None
|
111
|
+
# and __fields_set__ contains the field
|
112
|
+
if self.assists_turnover_ratio is None and "assists_turnover_ratio" in self.__fields_set__:
|
113
|
+
_dict['assistsTurnoverRatio'] = None
|
114
|
+
|
115
|
+
# set to None if game_score (nullable) is None
|
116
|
+
# and __fields_set__ contains the field
|
117
|
+
if self.game_score is None and "game_score" in self.__fields_set__:
|
118
|
+
_dict['gameScore'] = None
|
119
|
+
|
120
|
+
# set to None if true_shooting_pct (nullable) is None
|
121
|
+
# and __fields_set__ contains the field
|
122
|
+
if self.true_shooting_pct is None and "true_shooting_pct" in self.__fields_set__:
|
123
|
+
_dict['trueShootingPct'] = None
|
124
|
+
|
125
|
+
# set to None if effective_field_goal_pct (nullable) is None
|
126
|
+
# and __fields_set__ contains the field
|
127
|
+
if self.effective_field_goal_pct is None and "effective_field_goal_pct" in self.__fields_set__:
|
128
|
+
_dict['effectiveFieldGoalPct'] = None
|
129
|
+
|
130
|
+
# set to None if net_rating (nullable) is None
|
131
|
+
# and __fields_set__ contains the field
|
132
|
+
if self.net_rating is None and "net_rating" in self.__fields_set__:
|
133
|
+
_dict['netRating'] = None
|
134
|
+
|
135
|
+
# set to None if defensive_rating (nullable) is None
|
136
|
+
# and __fields_set__ contains the field
|
137
|
+
if self.defensive_rating is None and "defensive_rating" in self.__fields_set__:
|
138
|
+
_dict['defensiveRating'] = None
|
139
|
+
|
140
|
+
# set to None if offensive_rating (nullable) is None
|
141
|
+
# and __fields_set__ contains the field
|
142
|
+
if self.offensive_rating is None and "offensive_rating" in self.__fields_set__:
|
143
|
+
_dict['offensiveRating'] = None
|
144
|
+
|
145
|
+
# set to None if usage (nullable) is None
|
146
|
+
# and __fields_set__ contains the field
|
147
|
+
if self.usage is None and "usage" in self.__fields_set__:
|
148
|
+
_dict['usage'] = None
|
149
|
+
|
150
|
+
# set to None if blocks (nullable) is None
|
151
|
+
# and __fields_set__ contains the field
|
152
|
+
if self.blocks is None and "blocks" in self.__fields_set__:
|
153
|
+
_dict['blocks'] = None
|
154
|
+
|
155
|
+
# set to None if steals (nullable) is None
|
156
|
+
# and __fields_set__ contains the field
|
157
|
+
if self.steals is None and "steals" in self.__fields_set__:
|
158
|
+
_dict['steals'] = None
|
159
|
+
|
160
|
+
# set to None if assists (nullable) is None
|
161
|
+
# and __fields_set__ contains the field
|
162
|
+
if self.assists is None and "assists" in self.__fields_set__:
|
163
|
+
_dict['assists'] = None
|
164
|
+
|
165
|
+
# set to None if fouls (nullable) is None
|
166
|
+
# and __fields_set__ contains the field
|
167
|
+
if self.fouls is None and "fouls" in self.__fields_set__:
|
168
|
+
_dict['fouls'] = None
|
169
|
+
|
170
|
+
# set to None if turnovers (nullable) is None
|
171
|
+
# and __fields_set__ contains the field
|
172
|
+
if self.turnovers is None and "turnovers" in self.__fields_set__:
|
173
|
+
_dict['turnovers'] = None
|
174
|
+
|
175
|
+
# set to None if points (nullable) is None
|
176
|
+
# and __fields_set__ contains the field
|
177
|
+
if self.points is None and "points" in self.__fields_set__:
|
178
|
+
_dict['points'] = None
|
179
|
+
|
180
|
+
# set to None if minutes (nullable) is None
|
181
|
+
# and __fields_set__ contains the field
|
182
|
+
if self.minutes is None and "minutes" in self.__fields_set__:
|
183
|
+
_dict['minutes'] = None
|
184
|
+
|
185
|
+
# set to None if ejected (nullable) is None
|
186
|
+
# and __fields_set__ contains the field
|
187
|
+
if self.ejected is None and "ejected" in self.__fields_set__:
|
188
|
+
_dict['ejected'] = None
|
189
|
+
|
190
|
+
# set to None if starter (nullable) is None
|
191
|
+
# and __fields_set__ contains the field
|
192
|
+
if self.starter is None and "starter" in self.__fields_set__:
|
193
|
+
_dict['starter'] = None
|
194
|
+
|
195
|
+
return _dict
|
196
|
+
|
197
|
+
@classmethod
|
198
|
+
def from_dict(cls, obj: dict) -> GameBoxScorePlayersPlayersInner:
|
199
|
+
"""Create an instance of GameBoxScorePlayersPlayersInner from a dict"""
|
200
|
+
if obj is None:
|
201
|
+
return None
|
202
|
+
|
203
|
+
if not isinstance(obj, dict):
|
204
|
+
return GameBoxScorePlayersPlayersInner.parse_obj(obj)
|
205
|
+
|
206
|
+
_obj = GameBoxScorePlayersPlayersInner.parse_obj({
|
207
|
+
"rebounds": TeamSeasonUnitStatsRebounds.from_dict(obj.get("rebounds")) if obj.get("rebounds") is not None else None,
|
208
|
+
"free_throws": TeamSeasonUnitStatsFieldGoals.from_dict(obj.get("freeThrows")) if obj.get("freeThrows") is not None else None,
|
209
|
+
"three_point_field_goals": TeamSeasonUnitStatsFieldGoals.from_dict(obj.get("threePointFieldGoals")) if obj.get("threePointFieldGoals") is not None else None,
|
210
|
+
"two_point_field_goals": TeamSeasonUnitStatsFieldGoals.from_dict(obj.get("twoPointFieldGoals")) if obj.get("twoPointFieldGoals") is not None else None,
|
211
|
+
"field_goals": TeamSeasonUnitStatsFieldGoals.from_dict(obj.get("fieldGoals")) if obj.get("fieldGoals") is not None else None,
|
212
|
+
"offensive_rebound_pct": obj.get("offensiveReboundPct"),
|
213
|
+
"free_throw_rate": obj.get("freeThrowRate"),
|
214
|
+
"assists_turnover_ratio": obj.get("assistsTurnoverRatio"),
|
215
|
+
"game_score": obj.get("gameScore"),
|
216
|
+
"true_shooting_pct": obj.get("trueShootingPct"),
|
217
|
+
"effective_field_goal_pct": obj.get("effectiveFieldGoalPct"),
|
218
|
+
"net_rating": obj.get("netRating"),
|
219
|
+
"defensive_rating": obj.get("defensiveRating"),
|
220
|
+
"offensive_rating": obj.get("offensiveRating"),
|
221
|
+
"usage": obj.get("usage"),
|
222
|
+
"blocks": obj.get("blocks"),
|
223
|
+
"steals": obj.get("steals"),
|
224
|
+
"assists": obj.get("assists"),
|
225
|
+
"fouls": obj.get("fouls"),
|
226
|
+
"turnovers": obj.get("turnovers"),
|
227
|
+
"points": obj.get("points"),
|
228
|
+
"minutes": obj.get("minutes"),
|
229
|
+
"ejected": obj.get("ejected"),
|
230
|
+
"starter": obj.get("starter"),
|
231
|
+
"position": obj.get("position"),
|
232
|
+
"name": obj.get("name"),
|
233
|
+
"athlete_source_id": obj.get("athleteSourceId"),
|
234
|
+
"athlete_id": obj.get("athleteId")
|
235
|
+
})
|
236
|
+
return _obj
|
237
|
+
|
238
|
+
|
@@ -0,0 +1,148 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
College Basketball Data API
|
5
|
+
|
6
|
+
This API is in limited Beta for Patreon subscribers. It may have bugs and is subject to changes. API keys can be acquired from the CollegeFootballData.com website.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.1.0
|
9
|
+
Contact: admin@collegefootballdata.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from datetime import datetime
|
22
|
+
from typing import Optional, Union
|
23
|
+
from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr
|
24
|
+
from cbbd.models.game_box_score_team_stats import GameBoxScoreTeamStats
|
25
|
+
from cbbd.models.season_type import SeasonType
|
26
|
+
|
27
|
+
class GameBoxScoreTeam(BaseModel):
|
28
|
+
"""
|
29
|
+
GameBoxScoreTeam
|
30
|
+
"""
|
31
|
+
game_id: StrictInt = Field(default=..., alias="gameId")
|
32
|
+
season: StrictInt = Field(...)
|
33
|
+
season_label: StrictStr = Field(default=..., alias="seasonLabel")
|
34
|
+
season_type: SeasonType = Field(default=..., alias="seasonType")
|
35
|
+
start_date: datetime = Field(default=..., alias="startDate")
|
36
|
+
start_time_tbd: StrictBool = Field(default=..., alias="startTimeTbd")
|
37
|
+
team_id: StrictInt = Field(default=..., alias="teamId")
|
38
|
+
team: StrictStr = Field(...)
|
39
|
+
conference: Optional[StrictStr] = Field(...)
|
40
|
+
opponent_id: StrictInt = Field(default=..., alias="opponentId")
|
41
|
+
opponent: StrictStr = Field(...)
|
42
|
+
opponent_conference: Optional[StrictStr] = Field(default=..., alias="opponentConference")
|
43
|
+
neutral_site: StrictBool = Field(default=..., alias="neutralSite")
|
44
|
+
conference_game: StrictBool = Field(default=..., alias="conferenceGame")
|
45
|
+
game_type: Optional[StrictStr] = Field(default=..., alias="gameType")
|
46
|
+
notes: Optional[StrictStr] = Field(...)
|
47
|
+
game_minutes: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="gameMinutes")
|
48
|
+
pace: Optional[Union[StrictFloat, StrictInt]] = Field(...)
|
49
|
+
offense: GameBoxScoreTeamStats = Field(...)
|
50
|
+
defense: GameBoxScoreTeamStats = Field(...)
|
51
|
+
__properties = ["gameId", "season", "seasonLabel", "seasonType", "startDate", "startTimeTbd", "teamId", "team", "conference", "opponentId", "opponent", "opponentConference", "neutralSite", "conferenceGame", "gameType", "notes", "gameMinutes", "pace", "offense", "defense"]
|
52
|
+
|
53
|
+
class Config:
|
54
|
+
"""Pydantic configuration"""
|
55
|
+
allow_population_by_field_name = True
|
56
|
+
validate_assignment = True
|
57
|
+
|
58
|
+
def to_str(self) -> str:
|
59
|
+
"""Returns the string representation of the model using alias"""
|
60
|
+
return pprint.pformat(self.dict(by_alias=True))
|
61
|
+
|
62
|
+
def to_json(self) -> str:
|
63
|
+
"""Returns the JSON representation of the model using alias"""
|
64
|
+
return json.dumps(self.to_dict())
|
65
|
+
|
66
|
+
@classmethod
|
67
|
+
def from_json(cls, json_str: str) -> GameBoxScoreTeam:
|
68
|
+
"""Create an instance of GameBoxScoreTeam from a JSON string"""
|
69
|
+
return cls.from_dict(json.loads(json_str))
|
70
|
+
|
71
|
+
def to_dict(self):
|
72
|
+
"""Returns the dictionary representation of the model using alias"""
|
73
|
+
_dict = self.dict(by_alias=True,
|
74
|
+
exclude={
|
75
|
+
},
|
76
|
+
exclude_none=True)
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of offense
|
78
|
+
if self.offense:
|
79
|
+
_dict['offense'] = self.offense.to_dict()
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of defense
|
81
|
+
if self.defense:
|
82
|
+
_dict['defense'] = self.defense.to_dict()
|
83
|
+
# set to None if conference (nullable) is None
|
84
|
+
# and __fields_set__ contains the field
|
85
|
+
if self.conference is None and "conference" in self.__fields_set__:
|
86
|
+
_dict['conference'] = None
|
87
|
+
|
88
|
+
# set to None if opponent_conference (nullable) is None
|
89
|
+
# and __fields_set__ contains the field
|
90
|
+
if self.opponent_conference is None and "opponent_conference" in self.__fields_set__:
|
91
|
+
_dict['opponentConference'] = None
|
92
|
+
|
93
|
+
# set to None if game_type (nullable) is None
|
94
|
+
# and __fields_set__ contains the field
|
95
|
+
if self.game_type is None and "game_type" in self.__fields_set__:
|
96
|
+
_dict['gameType'] = None
|
97
|
+
|
98
|
+
# set to None if notes (nullable) is None
|
99
|
+
# and __fields_set__ contains the field
|
100
|
+
if self.notes is None and "notes" in self.__fields_set__:
|
101
|
+
_dict['notes'] = None
|
102
|
+
|
103
|
+
# set to None if game_minutes (nullable) is None
|
104
|
+
# and __fields_set__ contains the field
|
105
|
+
if self.game_minutes is None and "game_minutes" in self.__fields_set__:
|
106
|
+
_dict['gameMinutes'] = None
|
107
|
+
|
108
|
+
# set to None if pace (nullable) is None
|
109
|
+
# and __fields_set__ contains the field
|
110
|
+
if self.pace is None and "pace" in self.__fields_set__:
|
111
|
+
_dict['pace'] = None
|
112
|
+
|
113
|
+
return _dict
|
114
|
+
|
115
|
+
@classmethod
|
116
|
+
def from_dict(cls, obj: dict) -> GameBoxScoreTeam:
|
117
|
+
"""Create an instance of GameBoxScoreTeam from a dict"""
|
118
|
+
if obj is None:
|
119
|
+
return None
|
120
|
+
|
121
|
+
if not isinstance(obj, dict):
|
122
|
+
return GameBoxScoreTeam.parse_obj(obj)
|
123
|
+
|
124
|
+
_obj = GameBoxScoreTeam.parse_obj({
|
125
|
+
"game_id": obj.get("gameId"),
|
126
|
+
"season": obj.get("season"),
|
127
|
+
"season_label": obj.get("seasonLabel"),
|
128
|
+
"season_type": obj.get("seasonType"),
|
129
|
+
"start_date": obj.get("startDate"),
|
130
|
+
"start_time_tbd": obj.get("startTimeTbd"),
|
131
|
+
"team_id": obj.get("teamId"),
|
132
|
+
"team": obj.get("team"),
|
133
|
+
"conference": obj.get("conference"),
|
134
|
+
"opponent_id": obj.get("opponentId"),
|
135
|
+
"opponent": obj.get("opponent"),
|
136
|
+
"opponent_conference": obj.get("opponentConference"),
|
137
|
+
"neutral_site": obj.get("neutralSite"),
|
138
|
+
"conference_game": obj.get("conferenceGame"),
|
139
|
+
"game_type": obj.get("gameType"),
|
140
|
+
"notes": obj.get("notes"),
|
141
|
+
"game_minutes": obj.get("gameMinutes"),
|
142
|
+
"pace": obj.get("pace"),
|
143
|
+
"offense": GameBoxScoreTeamStats.from_dict(obj.get("offense")) if obj.get("offense") is not None else None,
|
144
|
+
"defense": GameBoxScoreTeamStats.from_dict(obj.get("defense")) if obj.get("defense") is not None else None
|
145
|
+
})
|
146
|
+
return _obj
|
147
|
+
|
148
|
+
|