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 Collector(CardsObject):
|
2018-10-22 14:19:38 +00:00
|
|
|
"""
|
|
|
|
cards/collector
|
|
|
|
Get a card by collector number.
|
2018-02-21 19:42:58 +00:00
|
|
|
|
2018-10-24 00:54:28 +00:00
|
|
|
Args:
|
|
|
|
code (string): This is the 3 letter code for the set
|
|
|
|
collector_number (string): This is the collector number of the card
|
|
|
|
lang (string, optional): Defaults to 'en'. A 2-3 character language code.
|
2018-02-21 19:42:58 +00:00
|
|
|
|
2018-10-26 21:24:34 +00:00
|
|
|
Returns:
|
|
|
|
N/A
|
|
|
|
|
2018-10-24 00:54:28 +00:00
|
|
|
Raises:
|
|
|
|
Exception: If the 'code' parameter is not provided.
|
|
|
|
Exception: If the 'collector_number' parameter is not provided.
|
|
|
|
Exception: If the object returned is an error.
|
2018-02-21 19:42:58 +00:00
|
|
|
|
2018-10-28 05:09:09 +00:00
|
|
|
Examples:
|
2018-10-28 05:48:20 +00:00
|
|
|
>>> card = scrython.cards.Collector(code="exo", collector_number="96")
|
2018-10-22 14:19:38 +00:00
|
|
|
>>> card.id()
|
|
|
|
"""
|
|
|
|
def __init__(self, **kwargs):
|
|
|
|
if kwargs.get('code') is None:
|
2018-10-24 00:54:28 +00:00
|
|
|
raise Exception('No code provided to search by')
|
|
|
|
elif kwargs.get('collector_number') is None:
|
|
|
|
raise Exception('No collector number provided to search by')
|
2018-02-13 21:51:03 +00:00
|
|
|
|
2018-10-22 14:19:38 +00:00
|
|
|
self.url = 'cards/{}/{}/{}?'.format(
|
|
|
|
kwargs.get('code'),
|
|
|
|
str(kwargs.get('collector_number')),
|
|
|
|
kwargs.get('lang', 'en')
|
|
|
|
)
|
|
|
|
super(Collector, self).__init__(self.url)
|