Skip to content

Models

Output dataclasses produced by gem.parse().

See also: Full Match Data, Quickstart

Notable recent fields

  • ParsedMatch.radiant_team_id / dire_team_id: int — tournament team ID (matches OpenDota /teams/{id} URL). 0 for pub games.
  • ParsedMatch.radiant_team_name / dire_team_name: str — team name (e.g. "Xtreme Gaming"). Empty string for pub games.
  • ParsedMatch.radiant_team_tag / dire_team_tag: str — team tag (e.g. "XG"). Empty string for pub games.
  • ParsedPlayer.steam_id: int — 64-bit Steam ID. 0 if unavailable.
  • ParsedPlayer.account_id: int — 32-bit account ID (the ID in OpenDota/Dotabuff player URLs). 0 if unavailable.
  • ParsedMatch.vision_modifiers: list[VisionModifierEvent] (experimental) — every application of a vision-granting modifier (Slardar Corrosive Haze, BH Track, Dust of Appearance, Gem of True Sight). See estimate_vision for how these integrate with the vision API.
  • ParsedMatch.tormentors: list[TormentorKill] — chronological Tormentor kill events.
  • ParsedMatch.shrines: list[ShrineKill] — chronological Shrine of Wisdom destruction events.
  • ParsedPlayer.damage_by_type: dict[str, int] — total damage dealt by damage type (physical, magical, pure).
  • ParsedPlayer.damage_taken_by_type: dict[str, int] — total damage taken by damage type.
  • ParsedPlayer.buyback_log: list[CombatLogEntry] — buyback events attributed to the player.
  • ParsedPlayer.lane_efficiency_pct: int — lane efficiency percentage derived from lane gold.

TormentorKill

  • tick: game tick of the kill.
  • killer: NPC name of the killing unit.
  • killer_player_id: player slot (0-9) of the killer when resolved, else -1.
  • kill_number: sequential Tormentor kill number in the match.

Generated API

Module gem.models

Output data models for gem replay parsing.

Source: src/gem/models.py

Top-level classes

VisionModifierEvent

python
class VisionModifierEvent

A vision-granting modifier applied to a hero (Slardar ulti, BH Track, Dust, Gem, etc.).

Source: src/gem/models.py:30

Dataclass fields

NameTypeDefault
tickint-
end_tick`intNone`
modifier_namestr-
target_namestr-
caster_namestr-
caster_teamint-

SmokeEvent

python
class SmokeEvent

One Smoke of Deceit activation.

Source: src/gem/models.py:56

Dataclass fields

NameTypeDefault
tickint-
activatorstr-
teamint-
smokedlist[str]field(...)
x`floatNone`
y`floatNone`

ChatEntry

python
class ChatEntry

A single chat message from the match.

Source: src/gem/models.py:79

Dataclass fields

NameTypeDefault
tickint-
player_slotint-
channelstr-
textstr-

ParsedPlayer

python
class ParsedPlayer

Aggregated statistics for one player over a full match.

Source: src/gem/models.py:101

Dataclass fields

NameTypeDefault
player_idint-
hero_namestr''
player_namestr''
steam_idint0
account_idint0
teamint0
timeslist[int]field(...)
gold_tlist[int]field(...)
total_earned_gold_tlist[int]field(...)
net_worth_tlist[int]field(...)
lh_tlist[int]field(...)
dn_tlist[int]field(...)
xp_tlist[int]field(...)
times_minlist[int]field(...)
gold_t_minlist[int]field(...)
total_earned_gold_t_minlist[int]field(...)
total_earned_xp_t_minlist[int]field(...)
net_worth_t_minlist[int]field(...)
lh_t_minlist[int]field(...)
dn_t_minlist[int]field(...)
xp_t_minlist[int]field(...)
total_hero_damage_t_minlist[int]field(...)
total_hero_healing_t_minlist[int]field(...)
total_deaths_t_minlist[int]field(...)
total_stuns_t_minlist[float]field(...)
obs_loglist[WardEvent]field(...)
sen_loglist[WardEvent]field(...)
damagedict[str, int]field(...)
damage_takendict[str, int]field(...)
damage_by_typedict[str, int]field(...)
damage_taken_by_typedict[str, int]field(...)
healingdict[str, int]field(...)
ability_usesdict[str, int]field(...)
item_usesdict[str, int]field(...)
gold_reasonsdict[str, int]field(...)
xp_reasonsdict[str, int]field(...)
kills_loglist[CombatLogEntry]field(...)
purchase_loglist[CombatLogEntry]field(...)
runes_loglist[CombatLogEntry]field(...)
buyback_loglist[CombatLogEntry]field(...)
lane_posdefaultdict[str, int]field(...)
position_loglist[tuple[int, float, float]]field(...)
stuns_dealtfloat0.0
killsint0
deathsint0
assistsint0
lane_roleint0
lane_last_hitsint0
lane_deniesint0
lane_total_goldint0
lane_total_xpint0
lane_efficiency_pctint0
lane_gold_adv`intNone`
lane_xp_adv`intNone`

ParsedMatch

python
class ParsedMatch

Top-level parsed output for a single Dota 2 replay.

Source: src/gem/models.py:253

Dataclass fields

NameTypeDefault
match_idint0
game_modeint0
leagueidint0
radiant_win`boolNone`
radiant_team_idint0
radiant_team_namestr''
radiant_team_tagstr''
dire_team_idint0
dire_team_namestr''
dire_team_tagstr''
game_start_tick`intNone`
game_end_tickint0
playerslist[ParsedPlayer]field(...)
towerslist[TowerKill]field(...)
barrackslist[BarracksKill]field(...)
roshanslist[RoshanKill]field(...)
aegis_eventslist[AegisEvent]field(...)
tormentorslist[TormentorKill]field(...)
shrineslist[ShrineKill]field(...)
wardslist[WardEvent]field(...)
radiant_gold_advlist[int]field(...)
radiant_xp_advlist[int]field(...)
combat_loglist[CombatLogEntry]field(...)
chatlist[ChatEntry]field(...)
courier_snapshotslist[CourierSnapshot]field(...)
smoke_eventslist[SmokeEvent]field(...)
draftlist[DraftEvent]field(...)
teamfightslist[Teamfight]field(...)
vision_modifierslist[VisionModifierEvent]field(...)

Properties

duration_seconds

Signature: def ParsedMatch.duration_seconds(self) -> float

Game duration in seconds, derived from game_start_tick and game_end_tick.

Source: src/gem/models.py:326

duration_minutes

Signature: def ParsedMatch.duration_minutes(self) -> float

Game duration in minutes, derived from game_start_tick and game_end_tick.

Source: src/gem/models.py:332