gem
v0.15.0

Catalog

Grouped accessors for bundled Dota metadata and static map data.

gem.constants remains available as a compatibility facade; new code can use gem.catalog or the more specific gem.catalog.* modules.


Generated API

Module gem.catalog.heroes

Hero catalog lookups backed by bundled dotaconstants data.

Source: src/gem/catalog/heroes.py

Top-level functions

hero_display

python
def hero_display(npc_name: str) -> str

Return the localized display name for an npc_dota_hero_* string.

Source: src/gem/catalog/heroes.py:16

hero_short

python
def hero_short(npc_name: str) -> str

Return display name from either a full npc_dota_hero_* or a bare suffix.

Source: src/gem/catalog/heroes.py:31

hero_npc_name

python
def hero_npc_name(name: str) -> str | None

Resolve a display name to its npc_dota_hero_* NPC name.

Source: src/gem/catalog/heroes.py:45

hero_meta

python
def hero_meta(npc_name: str) -> dict[str, Any]

Return the full hero metadata dict, or an empty dict if not found.

Source: src/gem/catalog/heroes.py:76

hero_id

python
def hero_id(npc_name: str) -> int

Return the numeric Dota 2 hero ID for an npc_dota_hero_* name.

Source: src/gem/catalog/heroes.py:88

Module gem.catalog.items

Item and permanent-buff catalog lookups.

Source: src/gem/catalog/items.py

Top-level functions

item_display

python
def item_display(internal: str) -> str

Return display name for an item_* prefixed internal name.

Source: src/gem/catalog/items.py:27

item_key_by_id

python
def item_key_by_id(item_id: int) -> str | None

Return the internal item key for an item ability ID.

Source: src/gem/catalog/items.py:45

permanent_buff_name

python
def permanent_buff_name(buff_id: int) -> str

Return the item name for a permanent buff integer ID.

Source: src/gem/catalog/items.py:57

Module gem.catalog.abilities

Ability catalog lookups backed by bundled dotaconstants data.

Source: src/gem/catalog/abilities.py

Top-level functions

ability_display

python
def ability_display(internal: str) -> str

Return display name for an ability or item internal name.

Source: src/gem/catalog/abilities.py:44

Module gem.catalog.xp

Hero experience threshold catalog.

Source: src/gem/catalog/xp.py

Top-level functions

xp_to_next_level

python
def xp_to_next_level(level: int, current_xp: int) -> int | None

Return XP needed to reach the next level, or None at max level.

Source: src/gem/catalog/xp.py:14

Module gem.catalog.leagues

League catalog lookups.

Source: src/gem/catalog/leagues.py

Top-level functions

league_name

python
def league_name(leagueid: int) -> str | None

Return the league name for a given league ID, or None if unknown/not found.

Source: src/gem/catalog/leagues.py:14

Module gem.catalog.map

Map catalog lookups for static map and neutral-camp data, and the map calibration.

Source: src/gem/catalog/map.py

Top-level functions

world_to_map_image

python
def world_to_map_image(x: float, y: float, width: float = MAP_IMAGE_WIDTH, height: float = MAP_IMAGE_HEIGHT) -> tuple[float, float]

Project world coordinates onto the 7.41 map image.

Source: src/gem/catalog/map.py:33

map_image_to_world

python
def map_image_to_world(px: float, py: float, width: float = MAP_IMAGE_WIDTH, height: float = MAP_IMAGE_HEIGHT) -> tuple[float, float]

Project a 7.41 map image pixel to world coordinates (inverse of :func:world_to_map_image).

Source: src/gem/catalog/map.py:57

load_camp_zones

python
def load_camp_zones() -> dict[str, Any]

Load calibrated neutral-camp zone geometry.

Source: src/gem/catalog/map.py:77

camps_on_patch

python
def camps_on_patch(patch: str, payload: dict[str, Any] | None = None) -> list[dict[str, Any]]

Return the camps camp_zones.json places on one patch's map.

Source: src/gem/catalog/map.py:86

load_map_constants

python
def load_map_constants() -> dict[str, Any]

Load static map calibration constants.

Source: src/gem/catalog/map.py:111

fountains_on_patch

python
def fountains_on_patch(patch: str, payload: dict[str, Any] | None = None) -> dict[str, dict[str, float]]

Return the fountain positions map_constants.json records for one patch.

Source: src/gem/catalog/map.py:120

load_neutral_camps

python
def load_neutral_camps() -> list[dict[str, Any]]

Load each neutral camp's ID, centre and type.

Source: src/gem/catalog/map.py:167

load_neutral_camp_centers

python
def load_neutral_camp_centers() -> dict[int, tuple[float, float]]

Load neutral camp IDs mapped to world-coordinate centers.

Source: src/gem/catalog/map.py:187

Module gem.catalog.resources

Bundled catalog resource loading.

Source: src/gem/catalog/resources.py

Top-level functions

load_data_text

python
def load_data_text(name: str) -> str

Load a bundled data file as text.

Source: src/gem/catalog/resources.py:16

load_data_json

python
def load_data_json(name: str) -> Any

Load a bundled JSON data file.

Source: src/gem/catalog/resources.py:28