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:

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