dotapatch.data

Module for the heropediadata api.

class dotapatch.data.HeropediaData[source]

Uses dota2’s heropediadata api to find the correct hero/item name.

get_hero_name(line)[source]

Searches the line for a hero name and returns its proper name.

Note

Juggernaut: base damage reduced by 2 returns juggernaut

Parameters:line (str) – The phrase to be checked
Returns:name – Proper hero name
Return type:str or None
get_item_name(line)[source]

Searches the line for an item name and returns its proper name.

Note

Dragon Lance: strength reduced from 14 to 13 returns dragon_lance

Parameters:line (str) – The phrase to be checked
Returns:name – Proper item name
Return type:str or None
classmethod sort_hero(hero_tuple)[source]

Formats hero_id to proper hero name.

Note

shredder returns timbersaw

Parameters:hero_tuple (tuple) – (name, _)
Returns:name – Proper hero name
Return type:str
classmethod sort_item(item_tuple)[source]

Formats item_id to proper item name.

Note

sphere returns linkens sphere

Parameters:item_tuple (tuple) – (name, _)
Returns:name – Proper item name
Return type:str