Refactor imports and standardize file naming: update module imports for consistency, align filenames with snake_case convention, and extract DynamicResponse to a dedicated module.
This commit is contained in:
parent
126d04ab0f
commit
bf5d1b890a
22 changed files with 160 additions and 145 deletions
31
src/geoguessr_mcp/models/season_stats.py
Normal file
31
src/geoguessr_mcp/models/season_stats.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
"""SeasonStats-related data models."""
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
|
||||
@dataclass
|
||||
class SeasonStats:
|
||||
"""Competitive season statistics."""
|
||||
|
||||
season_id: str
|
||||
season_name: str = ""
|
||||
rank: int = 0
|
||||
rating: int = 0
|
||||
games_played: int = 0
|
||||
wins: int = 0
|
||||
division: str = ""
|
||||
raw_data: dict = field(default_factory=dict)
|
||||
|
||||
@classmethod
|
||||
def from_api_response(cls, data: dict) -> "SeasonStats":
|
||||
"""Create SeasonStats from API response."""
|
||||
return cls(
|
||||
season_id=data.get("seasonId", data.get("id", "")),
|
||||
season_name=data.get("seasonName", data.get("name", "")),
|
||||
rank=data.get("rank", data.get("position", 0)),
|
||||
rating=data.get("rating", data.get("elo", data.get("score", 0))),
|
||||
games_played=data.get("gamesPlayed", data.get("games", 0)),
|
||||
wins=data.get("wins", 0),
|
||||
division=data.get("division", data.get("tier", "")),
|
||||
raw_data=data,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue