From 2df2505c8fd329dfb3c9a176dbb953a478fc7d8c Mon Sep 17 00:00:00 2001 From: NandaScott Date: Thu, 4 Mar 2021 23:06:10 -0500 Subject: [PATCH] Added support for the image_status field --- docs/scrython.cards/ArenaId.md | 10 ++++++++++ docs/scrython.cards/Collector.md | 10 ++++++++++ docs/scrython.cards/Id.md | 10 ++++++++++ docs/scrython.cards/Mtgo.md | 10 ++++++++++ docs/scrython.cards/Multiverse.md | 10 ++++++++++ docs/scrython.cards/Named.md | 10 ++++++++++ docs/scrython.cards/Random.md | 10 ++++++++++ scrython/cards/cards_object.py | 10 ++++++++++ setup.py | 2 +- unittests/test_cards.py | 3 +++ 10 files changed, 84 insertions(+), 1 deletion(-) diff --git a/docs/scrython.cards/ArenaId.md b/docs/scrython.cards/ArenaId.md index 6a26da5..507036e 100644 --- a/docs/scrython.cards/ArenaId.md +++ b/docs/scrython.cards/ArenaId.md @@ -251,6 +251,16 @@ The related id of the card art Returns: string +``` +--- +### `image_status()` + +``` +Provides insight to the status of the images of the card. + + Returns: + string: An enum of 'missing', 'placeholder', 'lowres', 'highres_scan' + ``` --- ### `image_uris()` diff --git a/docs/scrython.cards/Collector.md b/docs/scrython.cards/Collector.md index a216f95..ef7ef7c 100644 --- a/docs/scrython.cards/Collector.md +++ b/docs/scrython.cards/Collector.md @@ -248,6 +248,16 @@ The related id of the card art Returns: string +``` +--- +### `image_status()` + +``` +Provides insight to the status of the images of the card. + + Returns: + string: An enum of 'missing', 'placeholder', 'lowres', 'highres_scan' + ``` --- ### `image_uris()` diff --git a/docs/scrython.cards/Id.md b/docs/scrython.cards/Id.md index 064c3a3..ca1991e 100644 --- a/docs/scrython.cards/Id.md +++ b/docs/scrython.cards/Id.md @@ -251,6 +251,16 @@ The related id of the card art Returns: string +``` +--- +### `image_status()` + +``` +Provides insight to the status of the images of the card. + + Returns: + string: An enum of 'missing', 'placeholder', 'lowres', 'highres_scan' + ``` --- ### `image_uris()` diff --git a/docs/scrython.cards/Mtgo.md b/docs/scrython.cards/Mtgo.md index 75a8db1..64b03f0 100644 --- a/docs/scrython.cards/Mtgo.md +++ b/docs/scrython.cards/Mtgo.md @@ -251,6 +251,16 @@ The related id of the card art Returns: string +``` +--- +### `image_status()` + +``` +Provides insight to the status of the images of the card. + + Returns: + string: An enum of 'missing', 'placeholder', 'lowres', 'highres_scan' + ``` --- ### `image_uris()` diff --git a/docs/scrython.cards/Multiverse.md b/docs/scrython.cards/Multiverse.md index 5c82f6f..3e0f747 100644 --- a/docs/scrython.cards/Multiverse.md +++ b/docs/scrython.cards/Multiverse.md @@ -251,6 +251,16 @@ The related id of the card art Returns: string +``` +--- +### `image_status()` + +``` +Provides insight to the status of the images of the card. + + Returns: + string: An enum of 'missing', 'placeholder', 'lowres', 'highres_scan' + ``` --- ### `image_uris()` diff --git a/docs/scrython.cards/Named.md b/docs/scrython.cards/Named.md index 6872c17..5c9d123 100644 --- a/docs/scrython.cards/Named.md +++ b/docs/scrython.cards/Named.md @@ -253,6 +253,16 @@ The related id of the card art Returns: string +``` +--- +### `image_status()` + +``` +Provides insight to the status of the images of the card. + + Returns: + string: An enum of 'missing', 'placeholder', 'lowres', 'highres_scan' + ``` --- ### `image_uris()` diff --git a/docs/scrython.cards/Random.md b/docs/scrython.cards/Random.md index 23038d4..8f8808d 100644 --- a/docs/scrython.cards/Random.md +++ b/docs/scrython.cards/Random.md @@ -249,6 +249,16 @@ The related id of the card art Returns: string +``` +--- +### `image_status()` + +``` +Provides insight to the status of the images of the card. + + Returns: + string: An enum of 'missing', 'placeholder', 'lowres', 'highres_scan' + ``` --- ### `image_uris()` diff --git a/scrython/cards/cards_object.py b/scrython/cards/cards_object.py index 537be94..6451ec2 100644 --- a/scrython/cards/cards_object.py +++ b/scrython/cards/cards_object.py @@ -749,3 +749,13 @@ class CardsObject(FoundationObject): return self.scryfallJson['preview'][key] return self.scryfallJson['preview'] + + def image_status(self): + """Provides insight to the status of the images of the card. + + Returns: + string: An enum of 'missing', 'placeholder', 'lowres', 'highres_scan' + """ + super(CardsObject, self)._checkForKey('image_status') + + return self.scryfallJson['image_status'] \ No newline at end of file diff --git a/setup.py b/setup.py index c2aabd4..2f51d1b 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup setup( name='scrython', packages=['scrython', 'scrython.cards', 'scrython.rulings', 'scrython.catalog', 'scrython.sets', 'scrython.symbology', 'scrython.bulk_data'], - version='1.8.1', + version='1.9.0', description='A wrapper for using the Scryfall API.', long_description='https://github.com/NandaScott/Scrython/blob/master/README.md', url='https://github.com/NandaScott/Scrython', diff --git a/unittests/test_cards.py b/unittests/test_cards.py index 3dca286..1e685e8 100644 --- a/unittests/test_cards.py +++ b/unittests/test_cards.py @@ -212,6 +212,9 @@ class TestCardObjects(unittest.TestCase): self.assertIsInstance(preview_check.preview(), dict) self.assertIsInstance(preview_check.preview('source'), str) + def test_image_status(self): + self.assertIsInstance(non_online_card.image_status(), str) + class TestAutocomplete(unittest.TestCase): def test_object(self):