Scrython/scrython/cards/randomcard.py

36 lines
1.1 KiB
Python
Raw Normal View History

from .cards_object import CardsObject
class Random(CardsObject):
2018-02-21 19:42:58 +00:00
"""
cards/random
Get a random card.
Args:
format (string, optional):
Defaults to 'json'.
Returns data in the specified method.
face (string, optional):
Defaults to empty string.
If you're using the `image` format,
this will specify if you want the front or back face.
version (string, optional):
Defaults to empty string.
If you're using the `image` format, this will specify
if you want the small, normal, large, etc version of the image.
pretty (string, optional):
Defaults to empty string.
Returns a prettier version of the json object.
Note that this may break functionality with Scrython.
2018-02-21 19:42:58 +00:00
Raises:
Exception: If the object returned is an error.
2018-02-21 19:42:58 +00:00
Example usage:
>>> card = scrython.cards.Random()
>>> card.purchase_uris()
"""
def __init__(self):
2018-02-14 02:02:48 +00:00
self.url = 'cards/random?'
super(Random, self).__init__(self.url)