Skip to content

models

This module contains the models used to represent data returned by the WOM API.

Enums related to specific services are also housed in the module.

Tip

Most of the models here you won't create, but a few you will. Those will be documented as such.

Achievement

Bases: BaseModel

Represents an achievement made by a player.

Source code in wom/models/players/models.py
class Achievement(BaseModel):
    """Represents an achievement made by a player."""

    player_id: int
    """The unique ID of the player."""

    name: str
    """The name of the achievement."""

    metric: enums.Metric
    """The [`Metric`][wom.Metric] for this achievement."""

    measure: AchievementMeasure
    """The [`AchievementMeasure`][wom.AchievementMeasure] that
    the player obtained.
    """

    threshold: int
    """The threshold for this achievement."""

    created_at: datetime
    """The date the achievement was achieved."""

    accuracy: t.Optional[int]
    """The margin of error for the achievements creation date.

    !!! note

        Can be `None` if the achievement hasn't been recalculated since
        the addition of this field (~ Feb 2023). It can also be -1 for
        achievements with unknown dates.
    """

accuracy instance-attribute

accuracy: Optional[int]

The margin of error for the achievements creation date.

Note

Can be None if the achievement hasn't been recalculated since the addition of this field (~ Feb 2023). It can also be -1 for achievements with unknown dates.

created_at instance-attribute

created_at: datetime

The date the achievement was achieved.

measure instance-attribute

measure: AchievementMeasure

The AchievementMeasure that the player obtained.

metric instance-attribute

metric: Metric

The Metric for this achievement.

name instance-attribute

name: str

The name of the achievement.

player_id instance-attribute

player_id: int

The unique ID of the player.

threshold instance-attribute

threshold: int

The threshold for this achievement.

AchievementMeasure

Bases: BaseEnum

Measures used to categorize achievements.

Source code in wom/models/players/enums.py
class AchievementMeasure(BaseEnum):
    """Measures used to categorize achievements."""

    Levels = "levels"
    Experience = "experience"
    Kills = "kills"
    Score = "score"
    Value = "value"

AchievementProgress

Bases: BaseModel

Represents progress made toward an achievement.

Source code in wom/models/players/models.py
class AchievementProgress(BaseModel):
    """Represents progress made toward an achievement."""

    player_id: int
    """The unique ID of the player."""

    name: str
    """The name of the achievement."""

    metric: enums.Metric
    """The [`Metric`][wom.Metric] for this achievement."""

    measure: AchievementMeasure
    """The [`AchievementMeasure`][wom.AchievementMeasure] that
    the player obtained.
    """

    threshold: int
    """The threshold for this achievement."""

    created_at: t.Optional[datetime]
    """The date the achievement was achieved, or `None` if it has not
    been achieved.
    """

    accuracy: t.Optional[int]
    """The margin of error for the achievements creation date.

    !!! note

        Can be `None` if the achievement hasn't been recalculated since
        the addition of this field (~ Feb 2023). It can also be -1 for
        achievements with unknown dates.
    """

accuracy instance-attribute

accuracy: Optional[int]

The margin of error for the achievements creation date.

Note

Can be None if the achievement hasn't been recalculated since the addition of this field (~ Feb 2023). It can also be -1 for achievements with unknown dates.

created_at instance-attribute

created_at: Optional[datetime]

The date the achievement was achieved, or None if it has not been achieved.

measure instance-attribute

measure: AchievementMeasure

The AchievementMeasure that the player obtained.

metric instance-attribute

metric: Metric

The Metric for this achievement.

name instance-attribute

name: str

The name of the achievement.

player_id instance-attribute

player_id: int

The unique ID of the player.

threshold instance-attribute

threshold: int

The threshold for this achievement.

Activity

Bases: BaseModel

Details regarding a particular activity.

Source code in wom/models/players/models.py
class Activity(BaseModel):
    """Details regarding a particular activity."""

    metric: enums.Metric
    """The activity being measured."""

    rank: int
    """The players rank in the activity."""

    score: int
    """The players score in the activity."""

metric instance-attribute

metric: Metric

The activity being measured.

rank instance-attribute

rank: int

The players rank in the activity.

score instance-attribute

score: int

The players score in the activity.

ActivityGains

Bases: BaseModel

Represents activity gains made by a player.

Source code in wom/models/players/models.py
class ActivityGains(BaseModel):
    """Represents activity gains made by a player."""

    metric: enums.Metric
    """The activity being measured."""

    rank: Gains
    """The rank [`Gains`][wom.Gains]."""

    score: Gains
    """The score [`Gains`][wom.Gains]."""

metric instance-attribute

metric: Metric

The activity being measured.

rank instance-attribute

rank: Gains

The rank Gains.

score instance-attribute

score: Gains

The score Gains.

ActivityLeader

Bases: MetricLeader

Represents a leader in a particular activity.

Source code in wom/models/groups/models.py
class ActivityLeader(MetricLeader):
    """Represents a leader in a particular activity."""

    score: int
    """The players score in the activity."""

score instance-attribute

score: int

The players score in the activity.

Archive

Bases: BaseModel

Information detailing a player that has been archived.

Source code in wom/models/players/models.py
class Archive(BaseModel):
    """Information detailing a player that has been archived."""

    player_id: int
    """The ID of the parent player that was archived."""

    previous_username: str
    """The players previous username before the archive."""

    archive_username: str
    """The players placeholder username after the archive."""

    restored_username: t.Optional[str]
    """The players new username after restoration from archive. Can be
    `None` if the player has not been restored."""

    created_at: datetime
    """The date the archive was created."""

    restored_at: t.Optional[datetime]
    """The date the player was restored, if they have been."""

archive_username instance-attribute

archive_username: str

The players placeholder username after the archive.

created_at instance-attribute

created_at: datetime

The date the archive was created.

player_id instance-attribute

player_id: int

The ID of the parent player that was archived.

previous_username instance-attribute

previous_username: str

The players previous username before the archive.

restored_at instance-attribute

restored_at: Optional[datetime]

The date the player was restored, if they have been.

restored_username instance-attribute

restored_username: Optional[str]

The players new username after restoration from archive. Can be None if the player has not been restored.

BaseModel

Bases: Struct

The base model all library models inherit from.

Source code in wom/models/base.py
class BaseModel(msgspec.Struct, rename="camel"):
    """The base model all library models inherit from."""

    def to_dict(self) -> t.Dict[str, t.Any]:
        """Converts this class into a dictionary.

        Returns:
            The requested dictionary.
        """
        return msgspec.structs.asdict(self)

to_dict

to_dict() -> t.Dict[str, t.Any]

Converts this class into a dictionary.

Returns:

Type Description
Dict[str, Any]

The requested dictionary.

Source code in wom/models/base.py
def to_dict(self) -> t.Dict[str, t.Any]:
    """Converts this class into a dictionary.

    Returns:
        The requested dictionary.
    """
    return msgspec.structs.asdict(self)

Boss

Bases: BaseModel

Details regarding a particular boss.

Source code in wom/models/players/models.py
class Boss(BaseModel):
    """Details regarding a particular boss."""

    metric: enums.Metric
    """The boss being measured."""

    rank: int
    """The players rank in killing the boss."""

    kills: int
    """The number of kills the player has."""

    ehb: float
    """The players efficient hours bossed for the boss."""

ehb instance-attribute

ehb: float

The players efficient hours bossed for the boss.

kills instance-attribute

kills: int

The number of kills the player has.

metric instance-attribute

metric: Metric

The boss being measured.

rank instance-attribute

rank: int

The players rank in killing the boss.

BossGains

Bases: BaseModel

Represents boss gains made by a player.

Source code in wom/models/players/models.py
class BossGains(BaseModel):
    """Represents boss gains made by a player."""

    metric: enums.Metric
    """The boss being measured."""

    ehb: Gains
    """The efficient hours bossed [`Gains`][wom.Gains]."""

    rank: Gains
    """The rank [`Gains`][wom.Gains]."""

    kills: Gains
    """The boss kill [`Gains`][wom.Gains]."""

ehb instance-attribute

ehb: Gains

The efficient hours bossed Gains.

kills instance-attribute

kills: Gains

The boss kill Gains.

metric instance-attribute

metric: Metric

The boss being measured.

rank instance-attribute

rank: Gains

The rank Gains.

BossLeader

Bases: MetricLeader

Represents a leader in a particular boss.

Source code in wom/models/groups/models.py
class BossLeader(MetricLeader):
    """Represents a leader in a particular boss."""

    kills: int
    """The number of kills the player has."""

kills instance-attribute

kills: int

The number of kills the player has.

Competition

Bases: BaseModel

Represents a competition.

Source code in wom/models/competitions/models.py
class Competition(BaseModel):
    """Represents a competition."""

    id: int
    """The unique ID of the competition."""

    title: str
    """The title of the competition."""

    metric: enums.Metric
    """The metric being measured."""

    type: CompetitionType
    """The [CompetitionType][wom.CompetitionType]."""

    starts_at: datetime
    """The date the competition started at."""

    ends_at: datetime
    """The date the competition ended at."""

    group_id: t.Optional[int]
    """The optional group id associated with the competition."""

    score: int
    """The competition's score."""

    created_at: datetime
    """The date the competition was created."""

    updated_at: datetime
    """The date the competition was updated."""

    participant_count: int
    """The number of players participating."""

    group: t.Optional[Group] = None
    """The [`Group`][wom.Group] associated with the competition, if
    there is one.
    """

    participations: t.List[CompetitionParticipation] = []
    """A list containing the [`CompetitionParticipations`]
    [wom.CompetitionParticipation].
    """

created_at instance-attribute

created_at: datetime

The date the competition was created.

ends_at instance-attribute

ends_at: datetime

The date the competition ended at.

group class-attribute instance-attribute

group: Optional[Group] = None

The Group associated with the competition, if there is one.

group_id instance-attribute

group_id: Optional[int]

The optional group id associated with the competition.

id instance-attribute

id: int

The unique ID of the competition.

metric instance-attribute

metric: Metric

The metric being measured.

participant_count instance-attribute

participant_count: int

The number of players participating.

participations class-attribute instance-attribute

participations: List[CompetitionParticipation] = []

A list containing the CompetitionParticipations.

score instance-attribute

score: int

The competition's score.

starts_at instance-attribute

starts_at: datetime

The date the competition started at.

title instance-attribute

title: str

The title of the competition.

type instance-attribute

type: CompetitionType

updated_at instance-attribute

updated_at: datetime

The date the competition was updated.

CompetitionCSVTableType

Bases: BaseEnum

Table types used to return competition CSV details.

Source code in wom/models/competitions/enums.py
class CompetitionCSVTableType(BaseEnum):
    """Table types used to return competition CSV details."""

    Participants = "participants"
    Team = "team"
    Teams = "teams"

CompetitionDetail

Bases: Competition

Represents competition details.

Source code in wom/models/competitions/models.py
class CompetitionDetail(Competition):
    """Represents competition details."""

    participations: t.List[CompetitionParticipationDetail] = []  # type: ignore[assignment]
    """A list of [`CompetitionParticipationDetail`]
    [wom.CompetitionParticipationDetail] participations for this
    competition.
    """

participations class-attribute instance-attribute

participations: List[CompetitionParticipationDetail] = []

A list of CompetitionParticipationDetail participations for this competition.

CompetitionHistoryDataPoint

Bases: BaseModel

A competition history data point.

Source code in wom/models/competitions/models.py
class CompetitionHistoryDataPoint(BaseModel):
    """A competition history data point."""

    date: datetime
    """The date this data point occurred."""

    value: int
    """The value of the data point."""

date instance-attribute

date: datetime

The date this data point occurred.

value instance-attribute

value: int

The value of the data point.

CompetitionParticipation

Bases: Participation

Represents a competition participation.

Source code in wom/models/competitions/models.py
class CompetitionParticipation(Participation):
    """Represents a competition participation."""

    player: Player
    """The [`Player`][wom.Player] that participated in this competition."""

player instance-attribute

player: Player

The Player that participated in this competition.

CompetitionParticipationDetail

Bases: CompetitionParticipation

Represents competition participation details.

Source code in wom/models/competitions/models.py
class CompetitionParticipationDetail(CompetitionParticipation):
    """Represents competition participation details."""

    progress: CompetitionProgress
    """The [`CompetitionProgress`][wom.CompetitionProgress] that was
    made.
    """

    levels: CompetitionProgress
    """The [`CompetitionProgress`][wom.CompetitionProgress] as it relates to
    the number of levels gained. Only contains useful information for skilling
    competitions."""

levels instance-attribute

levels: CompetitionProgress

The CompetitionProgress as it relates to the number of levels gained. Only contains useful information for skilling competitions.

progress instance-attribute

progress: CompetitionProgress

The CompetitionProgress that was made.

CompetitionProgress

Bases: BaseModel

Represents progress in a competition.

Source code in wom/models/competitions/models.py
class CompetitionProgress(BaseModel):
    """Represents progress in a competition."""

    start: int
    """The starting value for the competition's metric."""

    end: int
    """The ending value for the competition's metric."""

    gained: int
    """The amount of progress gained in the metric."""

end instance-attribute

end: int

The ending value for the competition's metric.

gained instance-attribute

gained: int

The amount of progress gained in the metric.

start instance-attribute

start: int

The starting value for the competition's metric.

CompetitionStatus

Bases: BaseEnum

Potential competition statuses.

Source code in wom/models/competitions/enums.py
class CompetitionStatus(BaseEnum):
    """Potential competition statuses."""

    Upcoming = "upcoming"
    Ongoing = "ongoing"
    Finished = "finished"

CompetitionType

Bases: BaseEnum

Competition types available on WOM.

Source code in wom/models/competitions/enums.py
class CompetitionType(BaseEnum):
    """Competition types available on WOM."""

    Classic = "classic"
    Team = "team"

ComputedGains

Bases: BaseModel

Represents computed gains made by a player.

Source code in wom/models/players/models.py
class ComputedGains(BaseModel):
    """Represents computed gains made by a player."""

    metric: enums.Metric
    """The computed metric being measured."""

    rank: Gains
    """The rank [`Gains`][wom.Gains]."""

    value: Gains
    """The value [`Gains`][wom.Gains]."""

metric instance-attribute

metric: Metric

The computed metric being measured.

rank instance-attribute

rank: Gains

The rank Gains.

value instance-attribute

value: Gains

The value Gains.

ComputedMetric

Bases: BaseModel

Details regarding a computed metric.

Source code in wom/models/players/models.py
class ComputedMetric(BaseModel):
    """Details regarding a computed metric."""

    metric: enums.Metric
    """The computed metric being measured."""

    rank: int
    """The players rank in the computed metric."""

    value: float
    """The value of the computed metric."""

metric instance-attribute

metric: Metric

The computed metric being measured.

rank instance-attribute

rank: int

The players rank in the computed metric.

value instance-attribute

value: float

The value of the computed metric.

ComputedMetricLeader

Bases: MetricLeader

Represents a leader in a particular computed metric.

Source code in wom/models/groups/models.py
class ComputedMetricLeader(MetricLeader):
    """Represents a leader in a particular computed metric."""

    value: float
    """The value of the computed metric."""

value instance-attribute

value: float

The value of the computed metric.

Country

Bases: BaseEnum

Countries in the world.

Source code in wom/models/players/enums.py
class Country(BaseEnum):
    """Countries in the world."""

    Ad = "AD"
    Ae = "AE"
    Af = "AF"
    Ag = "AG"
    Ai = "AI"
    Al = "AL"
    Am = "AM"
    Ao = "AO"
    Aq = "AQ"
    Ar = "AR"
    As = "AS"
    At = "AT"
    Au = "AU"
    Aw = "AW"
    Ax = "AX"
    Az = "AZ"
    Ba = "BA"
    Bb = "BB"
    Bd = "BD"
    Be = "BE"
    Bf = "BF"
    Bg = "BG"
    Bh = "BH"
    Bi = "BI"
    Bj = "BJ"
    Bl = "BL"
    Bm = "BM"
    Bn = "BN"
    Bo = "BO"
    Bq = "BQ"
    Br = "BR"
    Bs = "BS"
    Bt = "BT"
    Bv = "BV"
    Bw = "BW"
    By = "BY"
    Bz = "BZ"
    Ca = "CA"
    Cc = "CC"
    Cd = "CD"
    Cf = "CF"
    Cg = "CG"
    Ch = "CH"
    Ci = "CI"
    Ck = "CK"
    Cl = "CL"
    Cm = "CM"
    Cn = "CN"
    Co = "CO"
    Cr = "CR"
    Cu = "CU"
    Cv = "CV"
    Cw = "CW"
    Cx = "CX"
    Cy = "CY"
    Cz = "CZ"
    De = "DE"
    Dj = "DJ"
    Dk = "DK"
    Dm = "DM"
    Do = "DO"
    Dz = "DZ"
    Ec = "EC"
    Ee = "EE"
    Eg = "EG"
    Eh = "EH"
    Er = "ER"
    Es = "ES"
    Et = "ET"
    Fi = "FI"
    Fj = "FJ"
    Fk = "FK"
    Fm = "FM"
    Fo = "FO"
    Fr = "FR"
    Ga = "GA"
    Gb = "GB"
    Gd = "GD"
    Ge = "GE"
    Gf = "GF"
    Gg = "GG"
    Gh = "GH"
    Gi = "GI"
    Gl = "GL"
    Gm = "GM"
    Gn = "GN"
    Gp = "GP"
    Gq = "GQ"
    Gr = "GR"
    Gs = "GS"
    Gt = "GT"
    Gu = "GU"
    Gw = "GW"
    Gy = "GY"
    Hk = "HK"
    Hm = "HM"
    Hn = "HN"
    Hr = "HR"
    Ht = "HT"
    Hu = "HU"
    Id = "ID"
    Ie = "IE"
    Il = "IL"
    Im = "IM"
    In = "IN"
    Io = "IO"
    Iq = "IQ"
    Ir = "IR"
    Is = "IS"
    It = "IT"
    Je = "JE"
    Jm = "JM"
    Jo = "JO"
    Jp = "JP"
    Ke = "KE"
    Kg = "KG"
    Kh = "KH"
    Ki = "KI"
    Km = "KM"
    Kn = "KN"
    Kp = "KP"
    Kr = "KR"
    Kw = "KW"
    Ky = "KY"
    Kz = "KZ"
    La = "LA"
    Lb = "LB"
    Lc = "LC"
    Li = "LI"
    Lk = "LK"
    Lr = "LR"
    Ls = "LS"
    Lt = "LT"
    Lu = "LU"
    Lv = "LV"
    Ly = "LY"
    Ma = "MA"
    Mc = "MC"
    Md = "MD"
    Me = "ME"
    Mf = "MF"
    Mg = "MG"
    Mh = "MH"
    Mk = "MK"
    Ml = "ML"
    Mm = "MM"
    Mn = "MN"
    Mo = "MO"
    Mp = "MP"
    Mq = "MQ"
    Mr = "MR"
    Ms = "MS"
    Mt = "MT"
    Mu = "MU"
    Mv = "MV"
    Mw = "MW"
    Mx = "MX"
    My = "MY"
    Mz = "MZ"
    Na = "NA"
    Nc = "NC"
    Ne = "NE"
    Nf = "NF"
    Ng = "NG"
    Ni = "NI"
    Nl = "NL"
    No = "NO"
    Np = "NP"
    Nr = "NR"
    Nu = "NU"
    Nz = "NZ"
    Om = "OM"
    Pa = "PA"
    Pe = "PE"
    Pf = "PF"
    Pg = "PG"
    Ph = "PH"
    Pk = "PK"
    Pl = "PL"
    Pm = "PM"
    Pn = "PN"
    Pr = "PR"
    Ps = "PS"
    Pt = "PT"
    Pw = "PW"
    Py = "PY"
    Qa = "QA"
    Re = "RE"
    Ro = "RO"
    Rs = "RS"
    Ru = "RU"
    Rw = "RW"
    Sa = "SA"
    Sb = "SB"
    Sc = "SC"
    Sd = "SD"
    Se = "SE"
    Sg = "SG"
    Sh = "SH"
    Si = "SI"
    Sj = "SJ"
    Sk = "SK"
    Sl = "SL"
    Sm = "SM"
    Sn = "SN"
    So = "SO"
    Sr = "SR"
    Ss = "SS"
    St = "ST"
    Sv = "SV"
    Sx = "SX"
    Sy = "SY"
    Sz = "SZ"
    Tc = "TC"
    Td = "TD"
    Tf = "TF"
    Tg = "TG"
    Th = "TH"
    Tj = "TJ"
    Tk = "TK"
    Tl = "TL"
    Tm = "TM"
    Tn = "TN"
    To = "TO"
    Tr = "TR"
    Tt = "TT"
    Tv = "TV"
    Tw = "TW"
    Tz = "TZ"
    Ua = "UA"
    Ug = "UG"
    Um = "UM"
    Us = "US"
    Uy = "UY"
    Uz = "UZ"
    Va = "VA"
    Vc = "VC"
    Ve = "VE"
    Vg = "VG"
    Vi = "VI"
    Vn = "VN"
    Vu = "VU"
    Wf = "WF"
    Ws = "WS"
    Ye = "YE"
    Yt = "YT"
    Za = "ZA"
    Zm = "ZM"
    Zw = "ZW"

CreatedCompetitionDetail

Bases: BaseModel

Represents a competition that was just created.

Source code in wom/models/competitions/models.py
class CreatedCompetitionDetail(BaseModel):
    """Represents a competition that was just created."""

    competition: Competition
    """The [`Competition`][wom.Competition] itself."""

    verification_code: str
    """The verification code for the competition."""

competition instance-attribute

competition: Competition

The Competition itself.

verification_code instance-attribute

verification_code: str

The verification code for the competition.

CreatedGroupDetail

Bases: BaseModel

Represents a newly created group.

Source code in wom/models/groups/models.py
class CreatedGroupDetail(BaseModel):
    """Represents a newly created group."""

    group: GroupDetail
    """The [`GroupDetail`][wom.GroupDetail] for the group."""

    verification_code: str
    """The verification code for the group.

    !!! note

        This should be kept safe and only shared trusted clan members.
    """

group instance-attribute

group: GroupDetail

The GroupDetail for the group.

verification_code instance-attribute

verification_code: str

The verification code for the group.

Note

This should be kept safe and only shared trusted clan members.

DeltaLeaderboardEntry

Bases: BaseModel

Represents a leaderboard entry over the given delta.

Source code in wom/models/deltas/models.py
class DeltaLeaderboardEntry(BaseModel):
    """Represents a leaderboard entry over the given delta."""

    player_id: int
    """The ID of the player holding this leaderboard entry."""

    gained: int
    """The value gained over the delta."""

    start_date: datetime
    """The start date of the delta."""

    end_date: datetime
    """The end date of the delta."""

    player: Player
    """The [`Player`][wom.Player] holding this leaderboard entry."""

end_date instance-attribute

end_date: datetime

The end date of the delta.

gained instance-attribute

gained: int

The value gained over the delta.

player instance-attribute

player: Player

The Player holding this leaderboard entry.

player_id instance-attribute

player_id: int

The ID of the player holding this leaderboard entry.

start_date instance-attribute

start_date: datetime

The start date of the delta.

Gains

Bases: BaseModel

Represents gains made by a player.

Source code in wom/models/players/models.py
class Gains(BaseModel):
    """Represents gains made by a player."""

    gained: float
    """The amount gained."""

    start: float
    """The starting amount."""

    end: float
    """The ending amount."""

end instance-attribute

end: float

The ending amount.

gained instance-attribute

gained: float

The amount gained.

start instance-attribute

start: float

The starting amount.

Group

Bases: BaseModel

Represents a group of players on WOM.

Source code in wom/models/groups/models.py
class Group(BaseModel):
    """Represents a group of players on WOM."""

    id: int
    """The unique ID for this group."""

    name: str
    """The groups name."""

    clan_chat: str
    """The clan chat for this group."""

    description: t.Optional[str]
    """The groups optional description."""

    homeworld: t.Optional[int]
    """The groups optional homeworld."""

    verified: bool
    """Whether or not this group is verified."""

    patron: bool
    """Whether or not this group is subscribed via Patreon."""

    profile_image: t.Optional[str]
    """The profile image url for this group, if any."""

    banner_image: t.Optional[str]
    """The banner image url for this group, if any."""

    score: int
    """The groups score."""

    created_at: datetime
    """The date the group was created."""

    updated_at: datetime
    """The date the group was updated."""

    member_count: int
    """The number of members in the group."""

banner_image instance-attribute

banner_image: Optional[str]

The banner image url for this group, if any.

clan_chat instance-attribute

clan_chat: str

The clan chat for this group.

created_at instance-attribute

created_at: datetime

The date the group was created.

description instance-attribute

description: Optional[str]

The groups optional description.

homeworld instance-attribute

homeworld: Optional[int]

The groups optional homeworld.

id instance-attribute

id: int

The unique ID for this group.

member_count instance-attribute

member_count: int

The number of members in the group.

name instance-attribute

name: str

The groups name.

patron instance-attribute

patron: bool

Whether or not this group is subscribed via Patreon.

profile_image instance-attribute

profile_image: Optional[str]

The profile image url for this group, if any.

score instance-attribute

score: int

The groups score.

updated_at instance-attribute

updated_at: datetime

The date the group was updated.

verified instance-attribute

verified: bool

Whether or not this group is verified.

GroupActivity

Bases: BaseModel

An activity that occurred in a group.

Source code in wom/models/groups/models.py
class GroupActivity(BaseModel):
    """An activity that occurred in a group."""

    group_id: int
    """The unique ID of the group this activity occurred for."""

    player_id: int
    """The unique ID of the player associated with this activity."""

    type: GroupActivityType
    """The type of activity that occurred."""

    role: t.Optional[GroupRole]
    """The players role in the group, if they have one."""

    previous_role: t.Optional[GroupRole]
    """The players previous role in the group, if they had one."""

    created_at: datetime
    """The datetime indicating when this activity occurred."""

    player: Player
    """The player associated with this activity."""

created_at instance-attribute

created_at: datetime

The datetime indicating when this activity occurred.

group_id instance-attribute

group_id: int

The unique ID of the group this activity occurred for.

player instance-attribute

player: Player

The player associated with this activity.

player_id instance-attribute

player_id: int

The unique ID of the player associated with this activity.

previous_role instance-attribute

previous_role: Optional[GroupRole]

The players previous role in the group, if they had one.

role instance-attribute

role: Optional[GroupRole]

The players role in the group, if they have one.

type instance-attribute

type: GroupActivityType

The type of activity that occurred.

GroupActivityType

Bases: BaseEnum

Activities that can occur for a group.

Source code in wom/models/groups/enums.py
class GroupActivityType(BaseEnum):
    """Activities that can occur for a group."""

    ChangedRole = "changed_role"
    Joined = "joined"
    Left = "left"

GroupDetail

Bases: Group

Represents details about a group.

Source code in wom/models/groups/models.py
class GroupDetail(Group):
    """Represents details about a group."""

    memberships: t.List[GroupMembership]
    """A list of [`GroupMemberships`][wom.GroupMembership]."""

    social_links: SocialLinks
    """The [`SocialLinks`][wom.SocialLinks] for the group."""

memberships instance-attribute

memberships: List[GroupMembership]

A list of GroupMemberships.

social_links: SocialLinks

The SocialLinks for the group.

GroupHiscoresActivityItem

Bases: BaseModel

Represents a group hiscores item for activities.

Source code in wom/models/groups/models.py
class GroupHiscoresActivityItem(BaseModel, tag="activity"):
    """Represents a group hiscores item for activities."""

    rank: int
    """The rank of the hiscore."""

    score: int
    """The activity score."""

rank instance-attribute

rank: int

The rank of the hiscore.

score instance-attribute

score: int

The activity score.

GroupHiscoresBossItem

Bases: BaseModel

Represents a group hiscores item for bosses.

Source code in wom/models/groups/models.py
class GroupHiscoresBossItem(BaseModel, tag="boss"):
    """Represents a group hiscores item for bosses."""

    rank: int
    """The rank of the hiscore."""

    kills: int
    """The number of boss kills."""

kills instance-attribute

kills: int

The number of boss kills.

rank instance-attribute

rank: int

The rank of the hiscore.

GroupHiscoresComputedMetricItem

Bases: BaseModel

Represents a group hiscores item for computed metrics.

Source code in wom/models/groups/models.py
class GroupHiscoresComputedMetricItem(BaseModel, tag="computed"):
    """Represents a group hiscores item for computed metrics."""

    rank: int
    """The rank of the hiscore."""

    value: int
    """The value of the computed metric."""

rank instance-attribute

rank: int

The rank of the hiscore.

value instance-attribute

value: int

The value of the computed metric.

GroupHiscoresEntry

Bases: BaseModel

Represents a group hiscores entry.

Source code in wom/models/groups/models.py
class GroupHiscoresEntry(BaseModel):
    """Represents a group hiscores entry."""

    player: Player
    """The [`Player`][wom.Player] responsible for the entry."""

    data: t.Union[
        GroupHiscoresActivityItem,
        GroupHiscoresBossItem,
        GroupHiscoresSkillItem,
        GroupHiscoresComputedMetricItem,
    ]
    """The data for this hiscores entry."""

data instance-attribute

data: Union[
    GroupHiscoresActivityItem,
    GroupHiscoresBossItem,
    GroupHiscoresSkillItem,
    GroupHiscoresComputedMetricItem,
]

The data for this hiscores entry.

player instance-attribute

player: Player

The Player responsible for the entry.

GroupHiscoresSkillItem

Bases: BaseModel

Represents a group hiscores item for skills.

Source code in wom/models/groups/models.py
class GroupHiscoresSkillItem(BaseModel, tag="skill"):
    """Represents a group hiscores item for skills."""

    rank: int
    """The rank of the hiscore."""

    level: int
    """The level of the skill."""

    experience: int
    """The experience in the skill."""

experience instance-attribute

experience: int

The experience in the skill.

level instance-attribute

level: int

The level of the skill.

rank instance-attribute

rank: int

The rank of the hiscore.

GroupMemberFragment

Bases: BaseModel

Represents a condensed group member.

Tip

This is a model class that you will create in order to send data to some endpoints.

Source code in wom/models/groups/models.py
class GroupMemberFragment(BaseModel):
    """Represents a condensed group member.

    !!! tip

        This is a model class that you will create in order to send
        data to some endpoints.
    """

    username: str
    """The group members username."""

    role: t.Optional[GroupRole] = None
    """The optional [`GroupRole`][wom.GroupRole] for the member.
    """

role class-attribute instance-attribute

role: Optional[GroupRole] = None

The optional GroupRole for the member.

username instance-attribute

username: str

The group members username.

GroupMemberGains

Bases: BaseModel

Represents a leaderboard entry over the given delta.

Source code in wom/models/groups/models.py
class GroupMemberGains(BaseModel):
    """Represents a leaderboard entry over the given delta."""

    start_date: datetime
    """The start date of the gains."""

    end_date: datetime
    """The end date of the gains."""

    player: Player
    """The [`Player`][wom.Player] that attained these gains."""

    data: Gains
    """The [`Gains`][wom.Gains] for this group member."""

data instance-attribute

data: Gains

The Gains for this group member.

end_date instance-attribute

end_date: datetime

The end date of the gains.

player instance-attribute

player: Player

The Player that attained these gains.

start_date instance-attribute

start_date: datetime

The start date of the gains.

GroupMembership

Bases: Membership

Represents a group membership.

Source code in wom/models/groups/models.py
class GroupMembership(Membership):
    """Represents a group membership."""

    player: Player
    """The [`Player`][wom.Player] that is a member."""

player instance-attribute

player: Player

The Player that is a member.

GroupRole

Bases: BaseEnum

Roles that can be assigned to group members.

Source code in wom/models/groups/enums.py
class GroupRole(BaseEnum):
    """Roles that can be assigned to group members."""

    Achiever = "achiever"
    Adamant = "adamant"
    Adept = "adept"
    Administrator = "administrator"
    Admiral = "admiral"
    Adventurer = "adventurer"
    Air = "air"
    Anchor = "anchor"
    Apothecary = "apothecary"
    Archer = "archer"
    Armadylean = "armadylean"
    Artillery = "artillery"
    Artisan = "artisan"
    Asgarnian = "asgarnian"
    Assassin = "assassin"
    Assistant = "assistant"
    Astral = "astral"
    Athlete = "athlete"
    Attacker = "attacker"
    Bandit = "bandit"
    Bandosian = "bandosian"
    Barbarian = "barbarian"
    Battlemage = "battlemage"
    Beast = "beast"
    Berserker = "berserker"
    Blisterwood = "blisterwood"
    Blood = "blood"
    Blue = "blue"
    Bob = "bob"
    Body = "body"
    Brassican = "brassican"
    Brawler = "brawler"
    Brigadier = "brigadier"
    Brigand = "brigand"
    Bronze = "bronze"
    Bruiser = "bruiser"
    Bulwark = "bulwark"
    Burglar = "burglar"
    Burnt = "burnt"
    Cadet = "cadet"
    Captain = "captain"
    Carry = "carry"
    Champion = "champion"
    Chaos = "chaos"
    Cleric = "cleric"
    Collector = "collector"
    Colonel = "colonel"
    Commander = "commander"
    Competitor = "competitor"
    Completionist = "completionist"
    Constructor = "constructor"
    Cook = "cook"
    Coordinator = "coordinator"
    Corporal = "corporal"
    Cosmic = "cosmic"
    Councillor = "councillor"
    Crafter = "crafter"
    Crew = "crew"
    Crusader = "crusader"
    Cutpurse = "cutpurse"
    Death = "death"
    Defender = "defender"
    Defiler = "defiler"
    Deputy_owner = "deputy_owner"
    Destroyer = "destroyer"
    Diamond = "diamond"
    Diseased = "diseased"
    Doctor = "doctor"
    Dogsbody = "dogsbody"
    Dragon = "dragon"
    Dragonstone = "dragonstone"
    Druid = "druid"
    Duellist = "duellist"
    Earth = "earth"
    Elite = "elite"
    Emerald = "emerald"
    Enforcer = "enforcer"
    Epic = "epic"
    Executive = "executive"
    Expert = "expert"
    Explorer = "explorer"
    Farmer = "farmer"
    Feeder = "feeder"
    Fighter = "fighter"
    Fire = "fire"
    Firemaker = "firemaker"
    Firestarter = "firestarter"
    Fisher = "fisher"
    Fletcher = "fletcher"
    Forager = "forager"
    Fremennik = "fremennik"
    Gamer = "gamer"
    Gatherer = "gatherer"
    General = "general"
    Gnome_child = "gnome_child"
    Gnome_elder = "gnome_elder"
    Goblin = "goblin"
    Gold = "gold"
    Goon = "goon"
    Green = "green"
    Grey = "grey"
    Guardian = "guardian"
    Guthixian = "guthixian"
    Harpoon = "harpoon"
    Healer = "healer"
    Hellcat = "hellcat"
    Helper = "helper"
    Herbologist = "herbologist"
    Hero = "hero"
    Holy = "holy"
    Hoarder = "hoarder"
    Hunter = "hunter"
    Ignitor = "ignitor"
    Illusionist = "illusionist"
    Imp = "imp"
    Infantry = "infantry"
    Inquisitor = "inquisitor"
    Iron = "iron"
    Jade = "jade"
    Justiciar = "justiciar"
    Kandarin = "kandarin"
    Karamjan = "karamjan"
    Kharidian = "kharidian"
    Kitten = "kitten"
    Knight = "knight"
    Labourer = "labourer"
    Law = "law"
    Leader = "leader"
    Learner = "learner"
    Legacy = "legacy"
    Legend = "legend"
    Legionnaire = "legionnaire"
    Lieutenant = "lieutenant"
    Looter = "looter"
    Lumberjack = "lumberjack"
    Magic = "magic"
    Magician = "magician"
    Major = "major"
    Maple = "maple"
    Marshal = "marshal"
    Master = "master"
    Maxed = "maxed"
    Mediator = "mediator"
    Medic = "medic"
    Mentor = "mentor"
    Member = "member"
    Merchant = "merchant"
    Mind = "mind"
    Miner = "miner"
    Minion = "minion"
    Misthalinian = "misthalinian"
    Mithril = "mithril"
    Moderator = "moderator"
    Monarch = "monarch"
    Morytanian = "morytanian"
    Mystic = "mystic"
    Myth = "myth"
    Natural = "natural"
    Nature = "nature"
    Necromancer = "necromancer"
    Ninja = "ninja"
    Noble = "noble"
    Novice = "novice"
    Nurse = "nurse"
    Oak = "oak"
    Officer = "officer"
    Onyx = "onyx"
    Opal = "opal"
    Oracle = "oracle"
    Orange = "orange"
    Owner = "owner"
    Page = "page"
    Paladin = "paladin"
    Pawn = "pawn"
    Pilgrim = "pilgrim"
    Pine = "pine"
    Pink = "pink"
    Prefect = "prefect"
    Priest = "priest"
    Private = "private"
    Prodigy = "prodigy"
    Proselyte = "proselyte"
    Prospector = "prospector"
    Protector = "protector"
    Pure = "pure"
    Purple = "purple"
    Pyromancer = "pyromancer"
    Quester = "quester"
    Racer = "racer"
    Raider = "raider"
    Ranger = "ranger"
    Record_chaser = "record_chaser"
    Recruit = "recruit"
    Recruiter = "recruiter"
    Red_topaz = "red_topaz"
    Red = "red"
    Rogue = "rogue"
    Ruby = "ruby"
    Rune = "rune"
    Runecrafter = "runecrafter"
    Sage = "sage"
    Sapphire = "sapphire"
    Saradominist = "saradominist"
    Saviour = "saviour"
    Scavenger = "scavenger"
    Scholar = "scholar"
    Scourge = "scourge"
    Scout = "scout"
    Scribe = "scribe"
    Seer = "seer"
    Senator = "senator"
    Sentry = "sentry"
    Serenist = "serenist"
    Sergeant = "sergeant"
    Shaman = "shaman"
    Sheriff = "sheriff"
    Short_green_guy = "short_green_guy"
    Skiller = "skiller"
    Skulled = "skulled"
    Slayer = "slayer"
    Smiter = "smiter"
    Smith = "smith"
    Smuggler = "smuggler"
    Sniper = "sniper"
    Soul = "soul"
    Specialist = "specialist"
    Speed_runner = "speed_runner"
    Spellcaster = "spellcaster"
    Squire = "squire"
    Staff = "staff"
    Steel = "steel"
    Strider = "strider"
    Striker = "striker"
    Summoner = "summoner"
    Superior = "superior"
    Supervisor = "supervisor"
    Teacher = "teacher"
    Templar = "templar"
    Therapist = "therapist"
    Thief = "thief"
    Tirannian = "tirannian"
    Trialist = "trialist"
    Trickster = "trickster"
    Tzkal = "tzkal"
    Tztok = "tztok"
    Unholy = "unholy"
    Vagrant = "vagrant"
    Vanguard = "vanguard"
    Walker = "walker"
    Wanderer = "wanderer"
    Warden = "warden"
    Warlock = "warlock"
    Warrior = "warrior"
    Water = "water"
    Wild = "wild"
    Willow = "willow"
    Wily = "wily"
    Wintumber = "wintumber"
    Witch = "witch"
    Wizard = "wizard"
    Worker = "worker"
    Wrath = "wrath"
    Xerician = "xerician"
    Yellow = "yellow"
    Yew = "yew"
    Zamorakian = "zamorakian"
    Zarosian = "zarosian"
    Zealot = "zealot"
    Zenyte = "zenyte"

GroupStatistics

Bases: BaseModel

Represents accumulated group statistics.

Source code in wom/models/groups/models.py
class GroupStatistics(BaseModel):
    """Represents accumulated group statistics."""

    maxed_combat_count: int
    """The number of maxed combat players in the group."""

    maxed_total_count: int
    """The number of maxed total level players in the group."""

    maxed_200ms_count: int = msgspec.field(name="maxed200msCount")
    """The number of maxed 200M xp players in the group."""

    average_stats: Snapshot
    """The average group statistics in a [`Snapshot`][wom.Snapshot]."""

    metric_leaders: MetricLeaders
    """The [`MetricLeaders`][wom.MetricLeaders] in this group for each
    metric.
    """

average_stats instance-attribute

average_stats: Snapshot

The average group statistics in a Snapshot.

maxed_200ms_count class-attribute instance-attribute

maxed_200ms_count: int = field(name='maxed200msCount')

The number of maxed 200M xp players in the group.

maxed_combat_count instance-attribute

maxed_combat_count: int

The number of maxed combat players in the group.

maxed_total_count instance-attribute

maxed_total_count: int

The number of maxed total level players in the group.

metric_leaders instance-attribute

metric_leaders: MetricLeaders

The MetricLeaders in this group for each metric.

HttpErrorResponse

Bases: BaseModel

Indicates something went wrong during the request.

Source code in wom/models/http.py
class HttpErrorResponse(BaseModel):
    """Indicates something went wrong during the request."""

    message: str
    """The error message."""

    status: int = -1
    """The HTTP status code."""

message instance-attribute

message: str

The error message.

status class-attribute instance-attribute

status: int = -1

The HTTP status code.

HttpSuccessResponse

Bases: BaseModel

Indicates a successful HTTP response.

Source code in wom/models/http.py
class HttpSuccessResponse(BaseModel):
    """Indicates a successful HTTP response."""

    message: str
    """The success message."""

    status: int = -1
    """The HTTP status code."""

message instance-attribute

message: str

The success message.

status class-attribute instance-attribute

status: int = -1

The HTTP status code.

Membership

Bases: BaseModel

Represents a membership in a group.

Source code in wom/models/groups/models.py
class Membership(BaseModel):
    """Represents a membership in a group."""

    player_id: int
    """The unique ID of the player in this membership."""

    group_id: int
    """The group ID this membership belongs to."""

    role: t.Optional[GroupRole]
    """The optional [`GroupRole`][wom.GroupRole] for this membership."""

    created_at: datetime
    """The date this membership was created."""

    updated_at: datetime
    """The date this membership was updated."""

created_at instance-attribute

created_at: datetime

The date this membership was created.

group_id instance-attribute

group_id: int

The group ID this membership belongs to.

player_id instance-attribute

player_id: int

The unique ID of the player in this membership.

role instance-attribute

role: Optional[GroupRole]

The optional GroupRole for this membership.

updated_at instance-attribute

updated_at: datetime

The date this membership was updated.

MetricLeader

Bases: BaseModel

Base class used to derive leaders in different metrics.

Source code in wom/models/groups/models.py
class MetricLeader(BaseModel):
    """Base class used to derive leaders in different metrics."""

    metric: enums.Metric
    """The metric being measured."""

    rank: int
    """The players rank in the metric."""

    player: t.Optional[Player]
    """The player leading in this metric, or `None` if none do."""

metric instance-attribute

metric: Metric

The metric being measured.

player instance-attribute

player: Optional[Player]

The player leading in this metric, or None if none do.

rank instance-attribute

rank: int

The players rank in the metric.

MetricLeaders

Bases: BaseModel

The leaders for each metric in a group.

Source code in wom/models/groups/models.py
class MetricLeaders(BaseModel):
    """The leaders for each metric in a group."""

    skills: t.Dict[enums.Metric, SkillLeader]
    """A mapping of skill keys to [`SkillLeader`][wom.SkillLeader] values."""

    bosses: t.Dict[enums.Metric, BossLeader]
    """A mapping of boss keys to [`BossLeader`][wom.BossLeader] values."""

    activities: t.Dict[enums.Metric, ActivityLeader]
    """A mapping of activity keys to [`ActivityLeader`]
    [wom.ActivityLeader] values.
    """

    computed: t.Dict[enums.Metric, ComputedMetricLeader]
    """A mapping of computed metric keys to
    [`ComputedMetricLeader`][wom.ComputedMetricLeader] values.
    """

activities instance-attribute

activities: Dict[Metric, ActivityLeader]

A mapping of activity keys to ActivityLeader values.

bosses instance-attribute

bosses: Dict[Metric, BossLeader]

A mapping of boss keys to BossLeader values.

computed instance-attribute

computed: Dict[Metric, ComputedMetricLeader]

A mapping of computed metric keys to ComputedMetricLeader values.

skills instance-attribute

skills: Dict[Metric, SkillLeader]

A mapping of skill keys to SkillLeader values.

NameChange

Bases: BaseModel

Represents a player name change.

Source code in wom/models/names/models.py
class NameChange(BaseModel):
    """Represents a player name change."""

    id: int
    """The unique ID of this name change."""

    player_id: int
    """The player ID associated with the name change."""

    old_name: str
    """The old username of the player."""

    new_name: str
    """The new username of the player."""

    status: NameChangeStatus
    """The [`status`][wom.NameChangeStatus] of the name change."""

    review_context: t.Optional[NameChangeReviewContext]
    """The [review context][wom.NameChangeReviewContext] associated with
    this name change, if it was denied or skipped.
    """

    resolved_at: t.Optional[datetime]
    """The date the name change was approved or denied."""

    updated_at: datetime
    """The date the name change was updated."""

    created_at: datetime
    """The date the name change was created."""

created_at instance-attribute

created_at: datetime

The date the name change was created.

id instance-attribute

id: int

The unique ID of this name change.

new_name instance-attribute

new_name: str

The new username of the player.

old_name instance-attribute

old_name: str

The old username of the player.

player_id instance-attribute

player_id: int

The player ID associated with the name change.

resolved_at instance-attribute

resolved_at: Optional[datetime]

The date the name change was approved or denied.

review_context instance-attribute

review_context: Optional[NameChangeReviewContext]

The review context associated with this name change, if it was denied or skipped.

status instance-attribute

status: NameChangeStatus

The status of the name change.

updated_at instance-attribute

updated_at: datetime

The date the name change was updated.

NameChangeReviewContext

Bases: BaseModel

The review context for a name change that was not approved.

Source code in wom/models/names/models.py
class NameChangeReviewContext(BaseModel):
    """The review context for a name change that was not approved."""

    reason: NameChangeReviewReason
    """The reason this name change was denied."""

    # TODO: Setting everything to None here is painful.
    # Determine with Ruben whether we want to keep this
    # public on the name change endpoints and if we do
    # determine how to handle it in a cleaner way.

    negative_gains: t.Optional[t.Dict[enums.Metric, int]] = None
    """The negative gains that were observed, if there were any. Only populated
    when the reason is `NegativeGains`.
    """

    max_hours_diff: t.Optional[int] = None
    """The max number of hours in the transition period. Only populated when
    reason is `TransitionTooLong`.
    """

    hours_diff: t.Optional[int] = None
    """The actual number of hours in the transition period. Only populated when
    reason is `TransitionTooLong` or `ExcessiveGains`.
    """

    ehp_diff: t.Optional[int] = None
    """The number difference between the old and new names ehp. Only populated
    when the reason is `ExcessiveGains`.
    """

    ehb_diff: t.Optional[int] = None
    """The number difference between the old and new names ehb. Only populated
    when the reason is `ExcessiveGains`.
    """

    min_total_level: t.Optional[int] = None
    """The minimum total level allowed for this name change. Only populated
    when the reason is `TotalLevelTooLow`.
    """

    total_level: t.Optional[int] = None
    """The number difference between the old and new names ehb. Only populated
    when the reason is `TotalLevelTooLow`.
    """

ehb_diff class-attribute instance-attribute

ehb_diff: Optional[int] = None

The number difference between the old and new names ehb. Only populated when the reason is ExcessiveGains.

ehp_diff class-attribute instance-attribute

ehp_diff: Optional[int] = None

The number difference between the old and new names ehp. Only populated when the reason is ExcessiveGains.

hours_diff class-attribute instance-attribute

hours_diff: Optional[int] = None

The actual number of hours in the transition period. Only populated when reason is TransitionTooLong or ExcessiveGains.

max_hours_diff class-attribute instance-attribute

max_hours_diff: Optional[int] = None

The max number of hours in the transition period. Only populated when reason is TransitionTooLong.

min_total_level class-attribute instance-attribute

min_total_level: Optional[int] = None

The minimum total level allowed for this name change. Only populated when the reason is TotalLevelTooLow.

negative_gains class-attribute instance-attribute

negative_gains: Optional[Dict[Metric, int]] = None

The negative gains that were observed, if there were any. Only populated when the reason is NegativeGains.

reason instance-attribute

reason: NameChangeReviewReason

The reason this name change was denied.

total_level class-attribute instance-attribute

total_level: Optional[int] = None

The number difference between the old and new names ehb. Only populated when the reason is TotalLevelTooLow.

NameChangeStatus

Bases: BaseEnum

The available name change statuses.

Source code in wom/models/names/enums.py
class NameChangeStatus(BaseEnum):
    """The available name change statuses."""

    Pending = "pending"
    Approved = "approved"
    Denied = "denied"

Participation

Bases: BaseModel

Represents participation in a competition.

Source code in wom/models/competitions/models.py
class Participation(BaseModel):
    """Represents participation in a competition."""

    player_id: int
    """The ID of the player associated with this participation."""

    competition_id: int
    """The ID of the competition associated with this participation."""

    team_name: t.Optional[str]
    """The optional team name associated with this participation."""

    created_at: datetime
    """The date this participation was created."""

    updated_at: datetime
    """The date this participation was updated."""

competition_id instance-attribute

competition_id: int

The ID of the competition associated with this participation.

created_at instance-attribute

created_at: datetime

The date this participation was created.

player_id instance-attribute

player_id: int

The ID of the player associated with this participation.

team_name instance-attribute

team_name: Optional[str]

The optional team name associated with this participation.

updated_at instance-attribute

updated_at: datetime

The date this participation was updated.

Player

Bases: BaseModel

Represents a player on WOM.

Source code in wom/models/players/models.py
class Player(BaseModel):
    """Represents a player on WOM."""

    id: int
    """The players unique ID."""

    username: str
    """The players username, always lowercase and 1-12 chars."""

    display_name: str
    """The players display name, supports capitalization ."""

    type: PlayerType
    """The [`PlayerType`][wom.PlayerType] for this player."""

    build: PlayerBuild
    """The [`PlayerBuild`][wom.PlayerBuild] for this player."""

    country: t.Optional[Country]
    """The players [`Country`][wom.Country] country of origin, if they
    have one set.
    """

    status: PlayerStatus
    """The players status, i.e. flagged, archived, etc."""

    exp: int
    """The players overall experience."""

    ehp: float
    """The players efficient hours played."""

    ehb: float
    """The players efficient hours bossed."""

    ttm: float
    """The players time to max, in hours."""

    tt200m: float
    """The players time to 200m xp all skills, in hours."""

    registered_at: datetime
    """The date the player was registered with WOM."""

    updated_at: t.Optional[datetime]
    """The date the player was last successfully updated with WOM."""

    last_changed_at: t.Optional[datetime]
    """The date of the players last change (xp gain, boss kc, etc)."""

    last_imported_at: t.Optional[datetime]
    """The date of the last player history import."""

build instance-attribute

build: PlayerBuild

The PlayerBuild for this player.

country instance-attribute

country: Optional[Country]

The players Country country of origin, if they have one set.

display_name instance-attribute

display_name: str

The players display name, supports capitalization .

ehb instance-attribute

ehb: float

The players efficient hours bossed.

ehp instance-attribute

ehp: float

The players efficient hours played.

exp instance-attribute

exp: int

The players overall experience.

id instance-attribute

id: int

The players unique ID.

last_changed_at instance-attribute

last_changed_at: Optional[datetime]

The date of the players last change (xp gain, boss kc, etc).

last_imported_at instance-attribute

last_imported_at: Optional[datetime]

The date of the last player history import.

registered_at instance-attribute

registered_at: datetime

The date the player was registered with WOM.

status instance-attribute

status: PlayerStatus

The players status, i.e. flagged, archived, etc.

tt200m instance-attribute

tt200m: float

The players time to 200m xp all skills, in hours.

ttm instance-attribute

ttm: float

The players time to max, in hours.

type instance-attribute

type: PlayerType

The PlayerType for this player.

updated_at instance-attribute

updated_at: Optional[datetime]

The date the player was last successfully updated with WOM.

username instance-attribute

username: str

The players username, always lowercase and 1-12 chars.

PlayerAchievementProgress

Bases: AchievementProgress

Represents a players progress toward an achievement.

Source code in wom/models/players/models.py
class PlayerAchievementProgress(AchievementProgress):
    """Represents a players progress toward an achievement."""

    current_value: int
    """The current value for the achievement's metric."""

    absolute_progress: float
    """The players current absolute progress toward the achievement.

    Scale of 0-1 with 1 being 100% progress.
    """

    relative_progress: float
    """The players current relative progress toward the achievement
    starting from the previous achievement.

    Scale of 0-1 with 1 being 100% progress.
    """

absolute_progress instance-attribute

absolute_progress: float

The players current absolute progress toward the achievement.

Scale of 0-1 with 1 being 100% progress.

current_value instance-attribute

current_value: int

The current value for the achievement's metric.

relative_progress instance-attribute

relative_progress: float

The players current relative progress toward the achievement starting from the previous achievement.

Scale of 0-1 with 1 being 100% progress.

PlayerArchive

Bases: Archive

Information detailing a player that has been archived, including the Player object.

Source code in wom/models/players/models.py
class PlayerArchive(Archive):
    """Information detailing a player that has been archived, including the
    [`Player`][wom.Player] object."""

    player: Player
    """The player information."""

player instance-attribute

player: Player

The player information.

PlayerBuild

Bases: BaseEnum

Potential account builds.

Source code in wom/models/players/enums.py
class PlayerBuild(BaseEnum):
    """Potential account builds."""

    Main = "main"
    F2p = "f2p"
    Lvl3 = "lvl3"
    Zerker = "zerker"
    Def1 = "def1"
    Hp10 = "hp10"
    F2pLvl3 = "f2p_lvl3"

PlayerCompetitionStanding

Bases: PlayerParticipation

Represents a players standing in a competition.

Source code in wom/models/competitions/models.py
class PlayerCompetitionStanding(PlayerParticipation):
    """Represents a players standing in a competition."""

    progress: CompetitionProgress
    """The [`CompetitionProgress`][wom.CompetitionProgress] that was
    made.
    """

    levels: CompetitionProgress
    """The [`CompetitionProgress`][wom.CompetitionProgress] that was
    made. Only contains useful information for skilling competitions.
    """

    rank: int
    """The rank in the competition standings."""

levels instance-attribute

levels: CompetitionProgress

The CompetitionProgress that was made. Only contains useful information for skilling competitions.

progress instance-attribute

progress: CompetitionProgress

The CompetitionProgress that was made.

rank instance-attribute

rank: int

The rank in the competition standings.

PlayerDetail

Bases: Player

Represents details about a player.

Source code in wom/models/players/models.py
class PlayerDetail(Player):
    """Represents details about a player."""

    combat_level: int
    """The players combat level."""

    latest_snapshot: t.Optional[Snapshot]
    """The latest snapshot for the player, if there is one."""

    archive: t.Optional[Archive] = None
    """The players archive information, if any."""

archive class-attribute instance-attribute

archive: Optional[Archive] = None

The players archive information, if any.

combat_level instance-attribute

combat_level: int

The players combat level.

latest_snapshot instance-attribute

latest_snapshot: Optional[Snapshot]

The latest snapshot for the player, if there is one.

PlayerGains

Bases: BaseModel

Gains made by a player.

Source code in wom/models/players/models.py
class PlayerGains(BaseModel):
    """Gains made by a player."""

    starts_at: datetime
    """The date the gains started at."""

    ends_at: datetime
    """The date the gains ended at."""

    data: PlayerGainsData
    """The [`PlayerGainsData`][wom.PlayerGainsData] for the player."""

data instance-attribute

data: PlayerGainsData

The PlayerGainsData for the player.

ends_at instance-attribute

ends_at: datetime

The date the gains ended at.

starts_at instance-attribute

starts_at: datetime

The date the gains started at.

PlayerGainsData

Bases: BaseModel

Contains all the player gains data.

Source code in wom/models/players/models.py
class PlayerGainsData(BaseModel):
    """Contains all the player gains data."""

    skills: t.Dict[enums.Metric, SkillGains]
    """A mapping of skill keys to [`SkillGains`] [wom.SkillGains] values."""

    bosses: t.Dict[enums.Metric, BossGains]
    """A mapping of boss keys to [`BossGains`][wom.BossGains] values."""

    activities: t.Dict[enums.Metric, ActivityGains]
    """A mapping of activity keys to [`ActivityGains`][wom.ActivityGains]
    values.
    """

    computed: t.Dict[enums.Metric, ComputedGains]
    """A mapping of computed metric keys to [`ComputedGains`]
    [wom.ComputedGains] values.
    """

activities instance-attribute

activities: Dict[Metric, ActivityGains]

A mapping of activity keys to ActivityGains values.

bosses instance-attribute

bosses: Dict[Metric, BossGains]

A mapping of boss keys to BossGains values.

computed instance-attribute

computed: Dict[Metric, ComputedGains]

A mapping of computed metric keys to ComputedGains values.

skills instance-attribute

skills: Dict[Metric, SkillGains]

A mapping of skill keys to SkillGains values.

PlayerMembership

Bases: Membership

Represents a player membership.

Source code in wom/models/groups/models.py
class PlayerMembership(Membership):
    """Represents a player membership."""

    group: Group
    """The [`Group`][wom.Group] the player is a member of."""

group instance-attribute

group: Group

The Group the player is a member of.

PlayerParticipation

Bases: Participation

Represents a players participation in a competition.

Source code in wom/models/competitions/models.py
class PlayerParticipation(Participation):
    """Represents a players participation in a competition."""

    competition: Competition
    """The [`Competition`][wom.Competition] that the player participated
    in.
    """

competition instance-attribute

competition: Competition

The Competition that the player participated in.

PlayerStatus

Bases: BaseEnum

Status for the players account.

Source code in wom/models/players/enums.py
class PlayerStatus(BaseEnum):
    """Status for the players account."""

    Active = "active"
    Unranked = "unranked"
    Flagged = "flagged"
    Archived = "archived"
    Banned = "banned"

PlayerType

Bases: BaseEnum

Different types of players.

Source code in wom/models/players/enums.py
class PlayerType(BaseEnum):
    """Different types of players."""

    Unknown = "unknown"
    Regular = "regular"
    Ironman = "ironman"
    Hardcore = "hardcore"
    Ultimate = "ultimate"
    FreshStart = "fresh_start"

Record

Bases: BaseModel

Represents a record held by a player.

Source code in wom/models/records/models.py
class Record(BaseModel):
    """Represents a record held by a player."""

    id: int
    """The unique ID for this record."""

    player_id: int
    """The player ID associated with this record."""

    period: enums.Period
    """The [`Period`][wom.Period] over which this record was achieved."""

    metric: enums.Metric
    """The [`Metric`][wom.Metric] measured in this record."""

    value: float
    """The records gained value."""

    updated_at: datetime
    """The records creation/modification date."""

id instance-attribute

id: int

The unique ID for this record.

metric instance-attribute

metric: Metric

The Metric measured in this record.

period instance-attribute

period: Period

The Period over which this record was achieved.

player_id instance-attribute

player_id: int

The player ID associated with this record.

updated_at instance-attribute

updated_at: datetime

The records creation/modification date.

value instance-attribute

value: float

The records gained value.

RecordLeaderboardEntry

Bases: Record

Represents a player's record leaderboard entry.

Source code in wom/models/records/models.py
class RecordLeaderboardEntry(Record):
    """Represents a player's record leaderboard entry."""

    player: Player
    """The [`Player`][wom.Player] holding this leaderboard entry."""

player instance-attribute

player: Player

The Player holding this leaderboard entry.

Skill

Bases: BaseModel

Details regarding a particular skill.

Source code in wom/models/players/models.py
class Skill(BaseModel):
    """Details regarding a particular skill."""

    metric: enums.Metric
    """The skill being measured."""

    rank: int
    """The players rank in the skill."""

    level: int
    """The players level in the skill."""

    experience: int
    """The players experience in the skill."""

    ehp: float
    """The players efficient hours played for the skill."""

ehp instance-attribute

ehp: float

The players efficient hours played for the skill.

experience instance-attribute

experience: int

The players experience in the skill.

level instance-attribute

level: int

The players level in the skill.

metric instance-attribute

metric: Metric

The skill being measured.

rank instance-attribute

rank: int

The players rank in the skill.

SkillGains

Bases: BaseModel

Represents skill gains made by a player.

Source code in wom/models/players/models.py
class SkillGains(BaseModel):
    """Represents skill gains made by a player."""

    metric: enums.Metric
    """The skill being measured."""

    experience: Gains
    """The experience [`Gains`][wom.Gains]."""

    ehp: Gains
    """The efficient hours played [`Gains`][wom.Gains]."""

    rank: Gains
    """The rank [`Gains`][wom.Gains]."""

    level: Gains
    """The level [`Gains`][wom.Gains]."""

ehp instance-attribute

ehp: Gains

The efficient hours played Gains.

experience instance-attribute

experience: Gains

The experience Gains.

level instance-attribute

level: Gains

The level Gains.

metric instance-attribute

metric: Metric

The skill being measured.

rank instance-attribute

rank: Gains

The rank Gains.

SkillLeader

Bases: MetricLeader

Represents a leader in a particular skill.

Source code in wom/models/groups/models.py
class SkillLeader(MetricLeader):
    """Represents a leader in a particular skill."""

    level: int
    """The players level in the skill."""

    experience: int
    """The players experience in the skill."""

experience instance-attribute

experience: int

The players experience in the skill.

level instance-attribute

level: int

The players level in the skill.

Snapshot

Bases: BaseModel

Represents a player snapshot.

Source code in wom/models/players/models.py
class Snapshot(BaseModel):
    """Represents a player snapshot."""

    id: int
    """The unique ID of the snapshot."""

    player_id: int
    """The unique ID of the player for this snapshot."""

    imported_at: t.Optional[datetime]
    """The date the snapshot was imported, if it was."""

    data: SnapshotData
    """The [`SnapshotData`][wom.SnapshotData] for the snapshot."""

    created_at: datetime
    """The date the snapshot was created."""

created_at instance-attribute

created_at: datetime

The date the snapshot was created.

data instance-attribute

data: SnapshotData

The SnapshotData for the snapshot.

id instance-attribute

id: int

The unique ID of the snapshot.

imported_at instance-attribute

imported_at: Optional[datetime]

The date the snapshot was imported, if it was.

player_id instance-attribute

player_id: int

The unique ID of the player for this snapshot.

SnapshotData

Bases: BaseModel

The data associated with this snapshot.

Source code in wom/models/players/models.py
class SnapshotData(BaseModel):
    """The data associated with this snapshot."""

    skills: t.Dict[enums.Metric, Skill]
    """A mapping of skill keys to skill values from this snapshot."""

    bosses: t.Dict[enums.Metric, Boss]
    """A mapping of boss keys to boss values from this snapshot."""

    activities: t.Dict[enums.Metric, Activity]
    """A mapping of activity keys to activity values from this snapshot."""

    computed: t.Dict[enums.Metric, ComputedMetric]
    """A mapping of computed metric keys to computed metric values from
    this snapshot.
    """

activities instance-attribute

activities: Dict[Metric, Activity]

A mapping of activity keys to activity values from this snapshot.

bosses instance-attribute

bosses: Dict[Metric, Boss]

A mapping of boss keys to boss values from this snapshot.

computed instance-attribute

computed: Dict[Metric, ComputedMetric]

A mapping of computed metric keys to computed metric values from this snapshot.

skills instance-attribute

skills: Dict[Metric, Skill]

A mapping of skill keys to skill values from this snapshot.

SnapshotTimelineEntry

Bases: BaseModel

An entry representing a point in time of a players gains.

Source code in wom/models/players/models.py
class SnapshotTimelineEntry(BaseModel):
    """An entry representing a point in time of a players gains."""

    value: int
    """The players value for a specific metric, at a specific point in
    time."""

    rank: int
    """The players rank for a specific metric, at a specific point in
    time."""

    date: datetime
    """The date this timeline entry was recorded."""

date instance-attribute

date: datetime

The date this timeline entry was recorded.

rank instance-attribute

rank: int

The players rank for a specific metric, at a specific point in time.

value instance-attribute

value: int

The players value for a specific metric, at a specific point in time.

Bases: BaseModel

A groups social links.

Source code in wom/models/groups/models.py
class SocialLinks(BaseModel):
    """A groups social links."""

    website: t.Optional[str] = None
    """The groups website url."""

    discord: t.Optional[str] = None
    """The groups discord invite url."""

    twitter: t.Optional[str] = None
    """The groups twitter url."""

    youtube: t.Optional[str] = None
    """The groups youtube url."""

    twitch: t.Optional[str] = None
    """The groups twitch url."""

discord class-attribute instance-attribute

discord: Optional[str] = None

The groups discord invite url.

twitch class-attribute instance-attribute

twitch: Optional[str] = None

The groups twitch url.

twitter class-attribute instance-attribute

twitter: Optional[str] = None

The groups twitter url.

website class-attribute instance-attribute

website: Optional[str] = None

The groups website url.

youtube class-attribute instance-attribute

youtube: Optional[str] = None

The groups youtube url.

Team

Bases: BaseModel

Represents a competition team.

Tip

This is a model class that you will create in order to send data to some endpoints.

Source code in wom/models/competitions/models.py
class Team(BaseModel):
    """Represents a competition team.

    !!! tip

        This is a model class that you will create in order to send
        data to some endpoints.
    """

    name: str
    """The name of the team."""

    participants: t.List[str]
    """A list of participant usernames on the team."""

name instance-attribute

name: str

The name of the team.

participants instance-attribute

participants: List[str]

A list of participant usernames on the team.

Top5ProgressResult

Bases: BaseModel

A top 5 progress result for a competition.

Source code in wom/models/competitions/models.py
class Top5ProgressResult(BaseModel):
    """A top 5 progress result for a competition."""

    player: Player
    """The [`Player`][wom.Player] who made top 5 progress."""

    history: t.List[CompetitionHistoryDataPoint]
    """A list of [CompetitionHistoryDataPoints]
    [wom.CompetitionHistoryDataPoint] making up the history
    of this top 5 progress result.
    """

history instance-attribute

history: List[CompetitionHistoryDataPoint]

A list of CompetitionHistoryDataPoints making up the history of this top 5 progress result.

player instance-attribute

player: Player

The Player who made top 5 progress.