Commit f42a186
committed
refactor: migrate people and data models to Pydantic
Models converted:
- people/attributes: BatSide, PitchHand, Position, Status, Home, School
- people/people: Person, Player, Coach, Batter, Pitcher, DraftPick
- data/data: PitchBreak, PitchCoordinates, PitchData, HitCoordinates,
HitData, CodeDesc, Violation, Count, PlayDetails
Key changes:
- All fields use snake_case with aliases for API compatibility
- Player uses model_validator to handle position -> primary_position mapping
- PlayDetails uses field_validator to convert empty dicts to None
- Fixed type mismatches: current_team is Team (not str), launch_angle is float
- Updated person tests to use new field names1 parent 983c271 commit f42a186
5 files changed
Lines changed: 451 additions & 499 deletions
File tree
- mlbstatsapi/models
- data
- people
- tests/external_tests/person
0 commit comments