bundle.marvel_rivals.client

Typed Marvel Rivals player statistics and a reusable HTTP client.

Attributes

Exceptions

MarvelRivalsError

A player lookup failed without exposing provider internals.

Classes

MarvelData

API model with stable, canonical Data serialization.

MatchStats

Shared combat statistics for ranked matches and individual heroes.

HeroStats

Hero performance shares the same combat model as ranked totals.

PlayerStats

Player overview with aliases for the API's nested response shape.

Champion

A playable hero from the public roster.

ChampionStats

Global hero totals; the API does not provide a season filter.

Patch

A dated game or balance update.

MarvelRivalsClient

One lazy HTTP connection pool shared by every bot command.

Module Contents

bundle.marvel_rivals.client.API_BASE_URL = 'https://marvelrivalsapi.com/api/v1'
exception bundle.marvel_rivals.client.MarvelRivalsError[source]

Bases: RuntimeError

A player lookup failed without exposing provider internals.

class bundle.marvel_rivals.client.MarvelData(/, **data: Any)[source]

Bases: bundle.core.data.Data

API model with stable, canonical Data serialization.

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class bundle.marvel_rivals.client.MatchStats(/, **data: Any)[source]

Bases: MarvelData

Shared combat statistics for ranked matches and individual heroes.

matches: int
wins: int
kills: int
deaths: int
assists: int
mvps: int
property win_rate: float | None
property kda: float | None
class bundle.marvel_rivals.client.HeroStats(/, **data: Any)[source]

Bases: MatchStats

Hero performance shares the same combat model as ranked totals.

name: str
play_time: int = 0
class bundle.marvel_rivals.client.PlayerStats(/, **data: Any)[source]

Bases: MarvelData

Player overview with aliases for the API’s nested response shape.

uid: int
name: str
level: int | str | None
rank: str | None
ranked: MatchStats
heroes: list[HeroStats]
season: int | None = None
property top_heroes: list[HeroStats]
classmethod from_api(payload: Any, *, season: int | None = None) → PlayerStats[source]

Validate provider data without manual field-by-field copying.

class bundle.marvel_rivals.client.Champion(/, **data: Any)[source]

Bases: MarvelData

A playable hero from the public roster.

id: str | int
name: str
role: str = 'Unknown'
property category: str
class bundle.marvel_rivals.client.ChampionStats(/, **data: Any)[source]

Bases: MatchStats

Global hero totals; the API does not provide a season filter.

name: str
id: str | int
total_hero_damage: int = 0
total_hero_heal: int = 0
total_damage_taken: int = 0
class bundle.marvel_rivals.client.Patch(/, **data: Any)[source]

Bases: MarvelData

A dated game or balance update.

title: str
date: str
summary: str
kind: str
class bundle.marvel_rivals.client.MarvelRivalsClient(api_key: str)[source]

One lazy HTTP connection pool shared by every bot command.

api_key
session: aiohttp.ClientSession | None = None
async close() → None[source]
async player(uid: str, *, season: int | None = None) → PlayerStats[source]

Retrieve ranked statistics by numeric player UID.

async champions() → list[Champion][source]

All known playable heroes sorted by name.

async champion_stats(query: str) → ChampionStats[source]

Global hero aggregates by name or numeric ID.

async updates(limit: int = 5) → list[Patch][source]

Recent game updates and balance releases, newest first.

async balances(limit: int = 3) → list[Patch][source]

Balance notes, not invented statistical win/pick rates.