Players
Classes related to player data in the API.
Bases: Model
Represents basic information about a player.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Player's in-game name. |
cur_head_icon_id |
str
|
ID of the current avatar or head icon. |
rank_season |
RankSeason
|
Ranking information for the current season. |
login_os |
str
|
Operating system used at last login (e.g., "1" = Android, "2" = iOS). |
raw_dict |
dict
|
The original JSON data used to create this instance. |
Source code in marvelrivalsapi\models.py
platform
property
Get the platform name based on the login OS code.
Returns:
| Type | Description |
|---|---|
str
|
The platform name (PC, PS or Xbox). |
from_dict(data)
classmethod
Create a PlayerInfo instance from a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict
|
Dictionary containing player info data. |
required |
Returns:
| Type | Description |
|---|---|
PlayerInfo
|
A new PlayerInfo instance. |
Source code in marvelrivalsapi\models.py
Bases: Model
Represents a player entry in the leaderboard.
Attributes:
| Name | Type | Description |
|---|---|---|
info |
PlayerInfo
|
Basic information about the player. |
player_uid |
int
|
Unique identifier for the player. |
matches |
int
|
Total matches played. |
wins |
int
|
Total matches won. |
kills |
int
|
Total kills achieved. |
deaths |
int
|
Total number of deaths. |
assists |
int
|
Total number of assists. |
play_time |
str
|
Total play time in minutes, as a string with decimal value. |
total_hero_damage |
str
|
Total damage dealt to enemy heroes. |
total_damage_taken |
str
|
Total damage taken from enemies. |
total_hero_heal |
str
|
Total healing done to heroes. |
mvps |
int
|
Number of times the player was MVP (Most Valuable Player). |
svps |
int
|
Number of times the player was SVP (Second Valuable Player). |
raw_dict |
dict
|
The original JSON data used to create this instance. |
Source code in marvelrivalsapi\models.py
546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 | |
avg_assists
property
avg_deaths
property
avg_hero_damage
property
Calculate average hero damage per match.
Returns:
| Type | Description |
|---|---|
float
|
Average hero damage per match. |
avg_kills
property
kda
property
Calculate KDA (Kills + Assists / Deaths) ratio.
Returns:
| Type | Description |
|---|---|
float
|
KDA ratio. Uses deaths = 1 if deaths = 0. |
mvp_rate
property
Calculate rate of MVP awards.
Returns:
| Type | Description |
|---|---|
float
|
Percentage of matches where player was MVP, as a decimal. |
win_rate
property
Calculate win rate for this player.
Returns:
| Type | Description |
|---|---|
float
|
Win rate as a decimal between 0 and 1. |
from_dict(data)
classmethod
Create a LeaderboardPlayer instance from a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict
|
Dictionary containing leaderboard player data. |
required |
Returns:
| Type | Description |
|---|---|
LeaderboardPlayer
|
A new LeaderboardPlayer instance. |