Added arena id endpoint

This commit is contained in:
Nanda Scott 2018-10-22 13:40:16 -04:00
parent 3a56295662
commit a525ad5971
3 changed files with 28 additions and 0 deletions

View File

@ -7,6 +7,7 @@ from scrython.cards import Multiverse
from scrython.cards import Named from scrython.cards import Named
from scrython.cards import Random from scrython.cards import Random
from scrython.cards import Search from scrython.cards import Search
from scrython.cards import ArenaId
#Import classes from rulings #Import classes from rulings
from scrython.rulings import Mtgo from scrython.rulings import Mtgo

View File

@ -6,3 +6,4 @@ from .multiverse import Multiverse
from .named import Named from .named import Named
from .randomcard import Random from .randomcard import Random
from .search import Search from .search import Search
from .arena_id import ArenaId

View File

@ -0,0 +1,26 @@
from .cards_object import CardsObject
class ArenaId(CardsObject):
"""
cards/id
Get a card by the Arena id.
Positional arguments:
id : str ....................... The Scryfall Id of the card.
Optional arguments:
Inherits all arguments from CardsObject.
Attributes:
All attributes are inherited from CardsObject.
Example usage:
>>> card = scrython.cards.ArenaId(id="66975")
>>> card.name()
"""
def __init__(self, **kwargs):
if kwargs.get('id') is None:
raise TypeError('No id provided to search by')
self.url = 'cards/arena/{}?'.format(str(kwargs.get('id')))
super(ArenaId, self).__init__(self.url)