2018-02-07 03:01:08 +00:00
|
|
|
from .cards_object import CardsObject
|
2018-01-11 03:04:03 +00:00
|
|
|
|
2018-02-07 03:01:08 +00:00
|
|
|
class Id(CardsObject):
|
2018-02-21 19:42:58 +00:00
|
|
|
"""
|
|
|
|
cards/id
|
|
|
|
Get a card by the Scryfall 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.Id(id="5386a61c-4928-4bd1-babe-5b089ab8b2d9")
|
|
|
|
>>> card.name()
|
|
|
|
"""
|
2018-01-30 03:54:20 +00:00
|
|
|
def __init__(self, **kwargs):
|
2018-02-13 21:51:03 +00:00
|
|
|
if kwargs.get('id') is None:
|
|
|
|
raise TypeError('No id provided to search by')
|
|
|
|
|
2018-02-14 02:02:48 +00:00
|
|
|
self.url = 'cards/{}?'.format(str(kwargs.get('id')))
|
2018-01-30 03:54:20 +00:00
|
|
|
super(Id, self).__init__(self.url)
|