Skip to content

Commit 4584e8f

Browse files
authored
Merge pull request #234 from louisadamian/update_get-player-stats
Update get_player_stats with new data types
2 parents 267dc92 + 76b8568 commit 4584e8f

4 files changed

Lines changed: 29 additions & 4 deletions

File tree

mlbstatsapi/models/stats/catching.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
class SimpleCatchingSplit:
1212
"""
1313
A class to represent a simple catching split
14-
14+
Age: int
15+
age at beginning of season
1516
gamesplayed : int
1617
The number of games played by the catcher
1718
runs : int
@@ -41,6 +42,8 @@ class SimpleCatchingSplit:
4142
see also: https://www.mlb.com/glossary/standard-stats/on-base-plus-slugging
4243
caughtstealing : int
4344
The number of runners caught stealing by the catcher.
45+
caughtstealingpercentage: str
46+
percentage of runners caught stealing by the catcher.
4447
stolenbases : int
4548
The number of stolen bases while catching.
4649
stolenbasepercentage : str
@@ -70,6 +73,7 @@ class SimpleCatchingSplit:
7073
passedball : int
7174
The number of passed balls while catching.
7275
"""
76+
age: Optional[int] = None
7377
gamesplayed: Optional[int] = None
7478
runs: Optional[int] = None
7579
homeruns: Optional[int] = None
@@ -84,6 +88,7 @@ class SimpleCatchingSplit:
8488
slg: Optional[str] = None
8589
ops: Optional[str] = None
8690
caughtstealing: Optional[int] = None
91+
caughtstealingpercentage: Optional[str]=None
8792
stolenbases: Optional[int] = None
8893
stolenbasepercentage: Optional[str] = None
8994
earnedruns: Optional[int] = None

mlbstatsapi/models/stats/fielding.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
class SimpleFieldingSplit:
1313
"""
1414
A class to represent a simple fielding split
15-
15+
age: int
16+
player age at the start of the season
1617
gamesplayed: int
1718
The number of games played
1819
gamesstarted: int
1920
The number of games started
2021
caughtstealing: int
2122
The number of runners caught stealing
23+
caughtstealingpercentage: str
24+
The percentage of runners caught stealing
2225
stolenbases: int
2326
The number of stolen bases
2427
stolenbasepercentage: str
@@ -60,10 +63,12 @@ class SimpleFieldingSplit:
6063
pickoffs: int
6164
The number of pick offs.
6265
"""
66+
age:Optional[int]=None
6367
position: Optional[Union[Position, dict]] = field(default_factory=dict)
6468
gamesplayed: Optional[int] = None
6569
gamesstarted: Optional[int] = None
6670
caughtstealing: Optional[int] = None
71+
caughtstealingpercentage: Optional[str] = None
6772
stolenbases: Optional[int] = None
6873
stolenbasepercentage: Optional[str] = None
6974
assists: Optional[int] = None

mlbstatsapi/models/stats/hitting.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class AdvancedHittingSplit:
2323
2424
Attributes
2525
----------
26+
age: int
27+
player age at the beginning of the season
2628
plateappearances : int
2729
The number of plate appearances.
2830
totalbases : int
@@ -95,8 +97,9 @@ class AdvancedHittingSplit:
9597
groundhits : int
9698
The amount of ground hits the batter has hit.
9799
linehits : int
98-
The amount of line hits the the batter has hit.
100+
The amount of line hits the batter has hit.
99101
"""
102+
age: Optional[int] = None
100103
plateappearances: Optional[int] = None
101104
totalbases: Optional[int] = None
102105
leftonbase: Optional[int] = None
@@ -136,7 +139,8 @@ def __repr__(self) -> str:
136139
class SimpleHittingSplit:
137140
"""
138141
A class to represent a simple hitting statistics
139-
142+
age: int
143+
players age at the beginning of the season
140144
gamesplayed : int
141145
The number of games played by the batter.
142146
flyouts : int
@@ -213,6 +217,7 @@ class SimpleHittingSplit:
213217
atbatsperhomerun : int
214218
The number of bats per home run of the batter.
215219
"""
220+
age: Optional[int] = None
216221
gamesplayed: Optional[int] = None
217222
flyouts: Optional[int] = None
218223
groundouts: Optional[int] = None
@@ -232,6 +237,7 @@ class SimpleHittingSplit:
232237
slg: Optional[str] = None
233238
ops: Optional[str] = None
234239
caughtstealing: Optional[int] = None
240+
caughtstealingpercentage: Optional[str] = None
235241
stolenbases: Optional[int] = None
236242
stolenbasepercentage: Optional[int] = None
237243
groundintodoubleplay: Optional[int] = None

mlbstatsapi/models/stats/pitching.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ class SimplePitchingSplit:
152152
The number of inherited runners for the pitcher.
153153
"""
154154
summary: Optional[str] = None
155+
age: Optional[int] = None
155156
gamesplayed: Optional[int] = None
156157
gamesstarted: Optional[int] = None
157158
flyouts: Optional[int] = None
@@ -172,6 +173,7 @@ class SimplePitchingSplit:
172173
slg: Optional[str] = None
173174
ops: Optional[str] = None
174175
caughtstealing: Optional[int] = None
176+
caughtstealingpercentage: Optional[str]=None
175177
stolenbases: Optional[int] = None
176178
stolenbasepercentage: Optional[str] = None
177179
groundintodoubleplay: Optional[int] = None
@@ -327,6 +329,7 @@ class AdvancedPitchingSplit:
327329
The number of bequeathed runners scored.
328330
see also: https://www.mlb.com/glossary/advanced-stats/bequeathed-runners
329331
"""
332+
age: Optional[int] = None
330333
winningpercentage: Optional[str] = None
331334
runsscoredper9: Optional[str] = None
332335
battersfaced: Optional[int] = None
@@ -352,6 +355,12 @@ class AdvancedPitchingSplit:
352355
pickoffs: Optional[int] = None
353356
totalswings: Optional[int] = None
354357
swingandmisses: Optional[int] = None
358+
strikeoutsminuswalkspercentage: Optional[str] = None
359+
gidppercentage: Optional[str] = None
360+
battersfacedpergame: Optional[str] = None
361+
buntsfailed: Optional[int] = None
362+
buntsmissedtipped: Optional[int] = None
363+
whiffpercentage: Optional[int] = None
355364
ballsinplay: Optional[int] = None
356365
runsupport: Optional[int] = None
357366
strikepercentage: Optional[str] = None

0 commit comments

Comments
 (0)