rivalsdata-api 1.2.1__tar.gz → 1.2.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: rivalsdata-api
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: Python client and MCP server for public Marvel Rivals stats from RivalsData
5
5
  Project-URL: Homepage, https://github.com/GS-Rionnag/rivalsdata-api
6
6
  Project-URL: Repository, https://github.com/GS-Rionnag/rivalsdata-api
@@ -64,6 +64,7 @@ print(hero_id("Loki")) # 1016
64
64
  with RivalsDataClient() as rd:
65
65
  player = rd.get_player("GS-") # numeric UID works too
66
66
  print(player.name, player.level, player.rank_game_season)
67
+ print(player.win_rate) # Current-season competitive win rate
67
68
 
68
69
  # Player profile sections are lazy resource managers.
69
70
  hero_season = player.heroes.fetch(season=20)
@@ -85,6 +86,11 @@ with RivalsDataClient() as rd:
85
86
  print(hero_season[0].win_rate) # integer percent when wins/losses are present
86
87
  ```
87
88
 
89
+ The player overview's overall win rate (`player.win_rate`) is the **current-season
90
+ competitive win rate**. It uses the latest available competitive season with
91
+ usable counts when a direct source rate is absent; it does not combine seasons.
92
+ Hero and class stats use the season selector supplied to their own methods.
93
+
88
94
  Calculated player class statistics are available through
89
95
  `player.stats.classes(season=20)` and the MCP `get_player_stats` tool with
90
96
  `category="classes"`. Pass a numeric season ID for that season, or
@@ -28,6 +28,7 @@ print(hero_id("Loki")) # 1016
28
28
  with RivalsDataClient() as rd:
29
29
  player = rd.get_player("GS-") # numeric UID works too
30
30
  print(player.name, player.level, player.rank_game_season)
31
+ print(player.win_rate) # Current-season competitive win rate
31
32
 
32
33
  # Player profile sections are lazy resource managers.
33
34
  hero_season = player.heroes.fetch(season=20)
@@ -49,6 +50,11 @@ with RivalsDataClient() as rd:
49
50
  print(hero_season[0].win_rate) # integer percent when wins/losses are present
50
51
  ```
51
52
 
53
+ The player overview's overall win rate (`player.win_rate`) is the **current-season
54
+ competitive win rate**. It uses the latest available competitive season with
55
+ usable counts when a direct source rate is absent; it does not combine seasons.
56
+ Hero and class stats use the season selector supplied to their own methods.
57
+
52
58
  Calculated player class statistics are available through
53
59
  `player.stats.classes(season=20)` and the MCP `get_player_stats` tool with
54
60
  `category="classes"`. Pass a numeric season ID for that season, or
@@ -48,6 +48,12 @@ integer percentage from a direct win-rate field, `wins`/`losses`, or the
48
48
  competitive profile row's `win_count`/`battle_count`. If the source provides
49
49
  none of these, it returns `None`.
50
50
 
51
+ The player overview's overall win rate (`Player.win_rate`) refers to the current
52
+ competitive season, using the latest available competitive season with usable
53
+ counts when a direct source rate is absent. It does not sum historical seasons.
54
+ MCP overview/dashboard descriptions identify this scope, and the dashboard labels
55
+ the value as a season win rate. Hero and class rates follow their season selectors.
56
+
51
57
  ## Observed UI and routes
52
58
 
53
59
  `player.stats.classes(season=...)` derives tank (Vanguard), support (Strategist),
@@ -15,7 +15,7 @@ as public, stable methods. Keep requests respectful and conservative.
15
15
  ## Current package
16
16
 
17
17
  - Distribution: `rivalsdata-api`; import: `rivalsdata`.
18
- - Version: `1.2.1`.
18
+ - Version: `1.2.2`.
19
19
  - Python `>=3.10`, Hatchling build, `src/` layout.
20
20
  - Runtime HTTP dependency: `curl-cffi`; optional browser fallback: Camoufox.
21
21
  - Public entry point: `RivalsDataClient`.
@@ -54,6 +54,12 @@ Favorites requires numeric UIDs and returns player summary rows.
54
54
  Rows offer `.win_rate` and `.winrate` integer-percent access when data supports
55
55
  it; all original data remains in mapping access.
56
56
 
57
+ The player overview's overall win rate (`player.win_rate`) is for the current
58
+ competitive season (latest available season with usable counts when there is no
59
+ direct source rate), not an all-seasons aggregate. Keep this scope explicit in
60
+ docs, MCP descriptions, and dashboard labels. Hero/class stats have separate
61
+ season selectors.
62
+
57
63
  `player.stats.classes(season=...)` groups observed hero IDs into tank, support,
58
64
  and DPS. Supply a numeric season ID for one season or `season="all"` for
59
65
  combined all-seasons stats; the latter sends `season=-1` to the upstream API.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "rivalsdata-api"
7
- version = "1.2.1"
7
+ version = "1.2.2"
8
8
  description = "Python client and MCP server for public Marvel Rivals stats from RivalsData"
9
9
  keywords = ["marvel-rivals", "rivalsdata", "game-stats", "api-client", "mcp"]
10
10
  readme = "README.md"
@@ -153,4 +153,4 @@ __all__ = [
153
153
  "hero_id",
154
154
  "hero_name",
155
155
  ]
156
- __version__ = "1.2.1"
156
+ __version__ = "1.2.2"
@@ -108,7 +108,11 @@ def search_players(name: str) -> dict[str, Any]:
108
108
 
109
109
  @mcp.tool()
110
110
  def get_player(uid_or_name: str) -> dict[str, Any]:
111
- """Get a public player overview by numeric UID or in-game name."""
111
+ """Get a public player overview by numeric UID or in-game name.
112
+
113
+ The overview's overall win rate refers to the current competitive season
114
+ (latest available season with usable counts), not all seasons combined.
115
+ """
112
116
  return _call(lambda client, value: client.get_player(value).raw, uid_or_name)
113
117
 
114
118
 
@@ -141,6 +145,7 @@ def show_player_dashboard(
141
145
  combining live-match, hero, and match-history pulls. MCP Apps hosts can
142
146
  render the returned dashboard resource; all values are escaped before HTML
143
147
  output.
148
+ The competitive record and win rate are for the latest available season.
144
149
  """
145
150
  with RivalsDataClient() as client:
146
151
  player = client.get_player(uid_or_name)
@@ -168,7 +173,7 @@ def show_player_dashboard(
168
173
  competitive_summary = (
169
174
  f'<div class="competitive-line">'
170
175
  f'<span>{battles:,} competitive games</span>'
171
- + (f'<span>{rate}% win rate</span>' if rate is not None else "")
176
+ + (f'<span>{rate}% season win rate</span>' if rate is not None else "")
172
177
  + (f'<span>{escape(str(score))} RP</span>' if score is not None else "")
173
178
  + '</div>'
174
179
  )
@@ -983,7 +983,11 @@ class Player(DataModel):
983
983
 
984
984
  @property
985
985
  def win_rate(self) -> int | None:
986
- """Overall competitive win rate when the profile includes wins/losses."""
986
+ """Current-season competitive win rate when profile counts are available.
987
+
988
+ Uses a direct source rate or the latest available competitive season
989
+ with usable counts. This property does not aggregate across seasons.
990
+ """
987
991
  direct = StatRecord(self._data).win_rate
988
992
  if direct is not None:
989
993
  return direct
File without changes