Repository navigation
rivals-api 5.0.0
Overall, hero, and class win-rate functions now default to provider summaries
without requesting match history. This changes the default counting semantics;
summary participation counts can differ from match-based attribution.
Migration
- Pass
method="precise"toplayer.stats.win_rate(),hero_win_rates(),
class_win_rates(),heroes(), orclasses()for match-based calculations.
Precise overall rates verify completed match outcomes; hero/class rates use
longest-played-hero attribution with explicit unresolved coverage. - Applicable MCP tools accept
method="normal"(default) or"precise".
Season and mode selectors and existing response envelopes are retained. - Legacy hero/class
exactaliases precise;estimatealiases normal summaries.
Explicit legacy overallmatches.fetch_win_rate(method="exact")retains
history-summary behavior; useprecisefor completed-outcome verification.
Changes
- Share scoped summary calculations across the three win-rate functions. Keep
provider counts intact, never average percentages, and expose selection,
disagreements, private snapshots, missing coverage, and count bases. - Persist collected history and match details in SQLite across client restarts.
Refresh each provider's newest pages until a cached match from a completed,
chronological traversal is found, then reuse its retained history tail.
Interrupted or unordered scans do not establish stopping boundaries. - Configure storage with
cache_dir,RIVALS_API_CACHE_DIR, or
persist_cache=False. Calculation caches remain short lived; incomplete
details are retried. Incremental reuse assumes no older-history backfill
behind a cached boundary. Neither method guarantees full game-history coverage. - Add regression coverage for summary-only requests, fractional counts,
missing modes, provider disagreements, restart reuse, pagination boundaries,
interrupted scans, and storage failures.
Validation: 202 tests passed; Ruff passed; wheel and source archive built and inspected.