Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query for language #14

Open
Codingboy opened this issue May 7, 2018 · 1 comment
Open

Query for language #14

Codingboy opened this issue May 7, 2018 · 1 comment

Comments

@Codingboy
Copy link

Only english cards are filtered.
Even Card.where(language='Portuguese (Brazil)').where(set="RIX").all() just brings up english text as states in a closed issue.

cards = Card.where(language="German").where(set="RIX").all()
for card in cards:
	print(card.name)
	print(card.mana_cost)
	print(card.supertypes)
	print(card.subtypes)
	print(card.types)
	print(card.rarity)
	print(card.text)
	print(card.power)
	print(card.toughness)
	print(card.loyalty)
	print(card.multiverse_id)
	print(card.image_url)
	print(card.set)
	print(card.set_name)
	print(card.rulings)

Example Output:

Angrath's Fury
{3}{B}{R}
None
None
['Sorcery']
Rare
Destroy target creature. Angrath's Fury deals 3 damage to target player. You may search your library and/or graveyard for a card named Angrath, Minotaur Pirate, reveal it, and put it into your hand. If you search your library this way, shuffle it.
None
None
None
441898
http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=441898&type=card
RIX
Rivals of Ixalan
[{'date': '2018-01-19', 'text': "You can't cast Angrath's Fury unless you choose both a target creature and a target player."}, {'date': '2018-01-19', 'text': "If either target becomes illegal after you cast Angrath's Fury but before it resolves, the other is still affected as appropriate and you'll search for Angrath. However, if both targets become illegal, the spell is countered and you won't search."}]
@Reid-E
Copy link
Contributor

Reid-E commented May 27, 2019

Language queries don't produce results in the given language.
Non-english names and text are provided with all API calls, and nested under a foreignNames key (in API JSON, which gets converted to foreign_names in Python).

You can get to the data you're looking for with:

[printing['text'] for printing in card.foreign_names if printing['language'] == 'Portuguese (Brazil)'][0]

You could also use any other code that checks the 'language' key in the 'foreign_names' dict, then gets the relevant info from that dict using keys like 'name', 'text', 'flavor', 'image_url'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants