The main Cards object

class pyartifact.api_sync.Cards(limit_sets=None, localize=None)[source]

Synchronous API around Artifact API sets of cards

Parameters:
  • limit_sets (Optional[List[str]]) – Whether to only fetch some sets, by default all ar used (‘00’, and ‘01’)
  • localize (Optional[str]) – Which language to fetch strings for. Will be turned into lowercase automatically.
filter

Creates a new filter instance with all the cards. :rtype: CardFilter :return:

find(name_approx, threshold=75)[source]

Finds a card by name, doesn’t have to be exact name, thanks to highly sophisticated AI - a.k.a. simple algorithm, that will try and guess what was meant.

This algorithm can change over time so don’t expect the same results across different versions.

Parameters:
  • name_approx (str) – Name to look up
  • threshold (int) – How strict to be, higher number -> less likely to find a result if the name is off, higher chance the result will be correct
Return type:

Union[Item, Hero, Ability, PassiveAbility, Improvement, Creep, Spell, None]

get(name, ignore_shared_name=True)[source]

Gets a card instance by name.

This is is a bit problematic, because some cards can have the same names as their ability. By default, this library will ignore that fact and return the not ability card. If it fails to find a card that’s not an ability, it’ll return the first one it registered.

You can override this behavior in which case this method will return a list of cards, instead of the card directly.

Parameters:
  • name (str) – Name of the card (case insensitive)
  • ignore_shared_name (bool) – If there are more cards with the same name, get just the first hit.
Return type:

Union[Item, Hero, Ability, PassiveAbility, Improvement, Creep, Spell, List[Union[Item, Hero, Ability, PassiveAbility, Improvement, Creep, Spell]]]

load_all_sets()[source]

Loads all the sets it should load from the api.

Return type:None