Merge pull request #69 from NandaScott/develop

Develop
This commit is contained in:
Nanda Scott 2021-09-06 12:40:38 -04:00 committed by GitHub
commit db147f81a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 270 additions and 64 deletions

View File

@ -4,11 +4,10 @@ on: [push, pull_request]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: [3.5, 3.6, 3.7, 3.8] python-version: [3.6, 3.7, 3.8, 3.9]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View File

@ -151,6 +151,17 @@ The rank of the card on edhrec.com
Returns: Returns:
int: The rank of the card on edhrec.co int: The rank of the card on edhrec.co
```
---
### `finishes()`
```
A list of computer-readable flags that indicate if this card
can come in foil, nonfoil, etched, or glossy finishes.
Returns:
list: A list of all finishes.
``` ```
--- ---
### `flavor_text()` ### `flavor_text()`
@ -166,7 +177,9 @@ The flavor text of the card, if any
### `foil()` ### `foil()`
``` ```
True if this printing exists in a foil version True if this printing exists in a foil version.
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -388,6 +401,8 @@ The oracle name of the card
``` ```
True if this printing does not exist in foil True if this printing does not exist in foil
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -463,7 +478,7 @@ Preview information for this card, if any.
### `prices()` ### `prices()`
``` ```
Returns prices from modes `usd`, `usd_foil`, `eur`, and `tix` Returns prices from modes `usd`, `usd_foil`, `usd_etched`, `usd_glossy`, `eur`, and `tix`
Args: Args:
mode (string): The prices to get mode (string): The prices to get
@ -665,6 +680,16 @@ True if this card is featured in the story
Returns: Returns:
boolean boolean
```
---
### `tcgplayer_etched_id()`
```
The `etched_id` of the card on TCGplayer.
Returns:
integer: The TCGplayer etched id of the card
``` ```
--- ---
### `tcgplayer_id()` ### `tcgplayer_id()`

View File

@ -148,6 +148,17 @@ The rank of the card on edhrec.com
Returns: Returns:
int: The rank of the card on edhrec.co int: The rank of the card on edhrec.co
```
---
### `finishes()`
```
A list of computer-readable flags that indicate if this card
can come in foil, nonfoil, etched, or glossy finishes.
Returns:
list: A list of all finishes.
``` ```
--- ---
### `flavor_text()` ### `flavor_text()`
@ -163,7 +174,9 @@ The flavor text of the card, if any
### `foil()` ### `foil()`
``` ```
True if this printing exists in a foil version True if this printing exists in a foil version.
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -385,6 +398,8 @@ The oracle name of the card
``` ```
True if this printing does not exist in foil True if this printing does not exist in foil
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -460,7 +475,7 @@ Preview information for this card, if any.
### `prices()` ### `prices()`
``` ```
Returns prices from modes `usd`, `usd_foil`, `eur`, and `tix` Returns prices from modes `usd`, `usd_foil`, `usd_etched`, `usd_glossy`, `eur`, and `tix`
Args: Args:
mode (string): The prices to get mode (string): The prices to get
@ -662,6 +677,16 @@ True if this card is featured in the story
Returns: Returns:
boolean boolean
```
---
### `tcgplayer_etched_id()`
```
The `etched_id` of the card on TCGplayer.
Returns:
integer: The TCGplayer etched id of the card
``` ```
--- ---
### `tcgplayer_id()` ### `tcgplayer_id()`

View File

@ -151,6 +151,17 @@ The rank of the card on edhrec.com
Returns: Returns:
int: The rank of the card on edhrec.co int: The rank of the card on edhrec.co
```
---
### `finishes()`
```
A list of computer-readable flags that indicate if this card
can come in foil, nonfoil, etched, or glossy finishes.
Returns:
list: A list of all finishes.
``` ```
--- ---
### `flavor_text()` ### `flavor_text()`
@ -166,7 +177,9 @@ The flavor text of the card, if any
### `foil()` ### `foil()`
``` ```
True if this printing exists in a foil version True if this printing exists in a foil version.
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -388,6 +401,8 @@ The oracle name of the card
``` ```
True if this printing does not exist in foil True if this printing does not exist in foil
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -463,7 +478,7 @@ Preview information for this card, if any.
### `prices()` ### `prices()`
``` ```
Returns prices from modes `usd`, `usd_foil`, `eur`, and `tix` Returns prices from modes `usd`, `usd_foil`, `usd_etched`, `usd_glossy`, `eur`, and `tix`
Args: Args:
mode (string): The prices to get mode (string): The prices to get
@ -665,6 +680,16 @@ True if this card is featured in the story
Returns: Returns:
boolean boolean
```
---
### `tcgplayer_etched_id()`
```
The `etched_id` of the card on TCGplayer.
Returns:
integer: The TCGplayer etched id of the card
``` ```
--- ---
### `tcgplayer_id()` ### `tcgplayer_id()`

View File

@ -151,6 +151,17 @@ The rank of the card on edhrec.com
Returns: Returns:
int: The rank of the card on edhrec.co int: The rank of the card on edhrec.co
```
---
### `finishes()`
```
A list of computer-readable flags that indicate if this card
can come in foil, nonfoil, etched, or glossy finishes.
Returns:
list: A list of all finishes.
``` ```
--- ---
### `flavor_text()` ### `flavor_text()`
@ -166,7 +177,9 @@ The flavor text of the card, if any
### `foil()` ### `foil()`
``` ```
True if this printing exists in a foil version True if this printing exists in a foil version.
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -388,6 +401,8 @@ The oracle name of the card
``` ```
True if this printing does not exist in foil True if this printing does not exist in foil
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -463,7 +478,7 @@ Preview information for this card, if any.
### `prices()` ### `prices()`
``` ```
Returns prices from modes `usd`, `usd_foil`, `eur`, and `tix` Returns prices from modes `usd`, `usd_foil`, `usd_etched`, `usd_glossy`, `eur`, and `tix`
Args: Args:
mode (string): The prices to get mode (string): The prices to get
@ -665,6 +680,16 @@ True if this card is featured in the story
Returns: Returns:
boolean boolean
```
---
### `tcgplayer_etched_id()`
```
The `etched_id` of the card on TCGplayer.
Returns:
integer: The TCGplayer etched id of the card
``` ```
--- ---
### `tcgplayer_id()` ### `tcgplayer_id()`

View File

@ -151,6 +151,17 @@ The rank of the card on edhrec.com
Returns: Returns:
int: The rank of the card on edhrec.co int: The rank of the card on edhrec.co
```
---
### `finishes()`
```
A list of computer-readable flags that indicate if this card
can come in foil, nonfoil, etched, or glossy finishes.
Returns:
list: A list of all finishes.
``` ```
--- ---
### `flavor_text()` ### `flavor_text()`
@ -166,7 +177,9 @@ The flavor text of the card, if any
### `foil()` ### `foil()`
``` ```
True if this printing exists in a foil version True if this printing exists in a foil version.
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -388,6 +401,8 @@ The oracle name of the card
``` ```
True if this printing does not exist in foil True if this printing does not exist in foil
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -463,7 +478,7 @@ Preview information for this card, if any.
### `prices()` ### `prices()`
``` ```
Returns prices from modes `usd`, `usd_foil`, `eur`, and `tix` Returns prices from modes `usd`, `usd_foil`, `usd_etched`, `usd_glossy`, `eur`, and `tix`
Args: Args:
mode (string): The prices to get mode (string): The prices to get
@ -665,6 +680,16 @@ True if this card is featured in the story
Returns: Returns:
boolean boolean
```
---
### `tcgplayer_etched_id()`
```
The `etched_id` of the card on TCGplayer.
Returns:
integer: The TCGplayer etched id of the card
``` ```
--- ---
### `tcgplayer_id()` ### `tcgplayer_id()`

View File

@ -153,6 +153,17 @@ The rank of the card on edhrec.com
Returns: Returns:
int: The rank of the card on edhrec.co int: The rank of the card on edhrec.co
```
---
### `finishes()`
```
A list of computer-readable flags that indicate if this card
can come in foil, nonfoil, etched, or glossy finishes.
Returns:
list: A list of all finishes.
``` ```
--- ---
### `flavor_text()` ### `flavor_text()`
@ -168,7 +179,9 @@ The flavor text of the card, if any
### `foil()` ### `foil()`
``` ```
True if this printing exists in a foil version True if this printing exists in a foil version.
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -390,6 +403,8 @@ The oracle name of the card
``` ```
True if this printing does not exist in foil True if this printing does not exist in foil
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -465,7 +480,7 @@ Preview information for this card, if any.
### `prices()` ### `prices()`
``` ```
Returns prices from modes `usd`, `usd_foil`, `eur`, and `tix` Returns prices from modes `usd`, `usd_foil`, `usd_etched`, `usd_glossy`, `eur`, and `tix`
Args: Args:
mode (string): The prices to get mode (string): The prices to get
@ -667,6 +682,16 @@ True if this card is featured in the story
Returns: Returns:
boolean boolean
```
---
### `tcgplayer_etched_id()`
```
The `etched_id` of the card on TCGplayer.
Returns:
integer: The TCGplayer etched id of the card
``` ```
--- ---
### `tcgplayer_id()` ### `tcgplayer_id()`

View File

@ -149,6 +149,17 @@ The rank of the card on edhrec.com
Returns: Returns:
int: The rank of the card on edhrec.co int: The rank of the card on edhrec.co
```
---
### `finishes()`
```
A list of computer-readable flags that indicate if this card
can come in foil, nonfoil, etched, or glossy finishes.
Returns:
list: A list of all finishes.
``` ```
--- ---
### `flavor_text()` ### `flavor_text()`
@ -164,7 +175,9 @@ The flavor text of the card, if any
### `foil()` ### `foil()`
``` ```
True if this printing exists in a foil version True if this printing exists in a foil version.
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -386,6 +399,8 @@ The oracle name of the card
``` ```
True if this printing does not exist in foil True if this printing does not exist in foil
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
@ -461,7 +476,7 @@ Preview information for this card, if any.
### `prices()` ### `prices()`
``` ```
Returns prices from modes `usd`, `usd_foil`, `eur`, and `tix` Returns prices from modes `usd`, `usd_foil`, `usd_etched`, `usd_glossy`, `eur`, and `tix`
Args: Args:
mode (string): The prices to get mode (string): The prices to get
@ -663,6 +678,16 @@ True if this card is featured in the story
Returns: Returns:
boolean boolean
```
---
### `tcgplayer_etched_id()`
```
The `etched_id` of the card on TCGplayer.
Returns:
integer: The TCGplayer etched id of the card
``` ```
--- ---
### `tcgplayer_id()` ### `tcgplayer_id()`

View File

@ -1,2 +1,2 @@
aiohttp==3.6.1 aiohttp==3.7.4
asyncio==3.4.3 asyncio==3.4.3

View File

@ -91,6 +91,16 @@ class CardsObject(FoundationObject):
return self.scryfallJson['tcgplayer_id'] return self.scryfallJson['tcgplayer_id']
def tcgplayer_etched_id(self):
"""The `etched_id` of the card on TCGplayer.
Returns:
integer: The TCGplayer etched id of the card
"""
super(CardsObject, self)._checkForKey('tcgplayer_etched_id')
return self.scryfallJson['tcgplayer_etched_id']
def name(self): def name(self):
"""The oracle name of the card """The oracle name of the card
@ -167,6 +177,7 @@ class CardsObject(FoundationObject):
'meld': lambda num: self.scryfallJson['image_uris'], 'meld': lambda num: self.scryfallJson['image_uris'],
'leveler': lambda num: self.scryfallJson['image_uris'], 'leveler': lambda num: self.scryfallJson['image_uris'],
'saga': lambda num: self.scryfallJson['image_uris'], 'saga': lambda num: self.scryfallJson['image_uris'],
'class': lambda num: self.scryfallJson['image_uris'],
'planar': lambda num: self.scryfallJson['image_uris'], 'planar': lambda num: self.scryfallJson['image_uris'],
'scheme': lambda num: self.scryfallJson['image_uris'], 'scheme': lambda num: self.scryfallJson['image_uris'],
'vanguard': lambda num: self.scryfallJson['image_uris'], 'vanguard': lambda num: self.scryfallJson['image_uris'],
@ -462,7 +473,7 @@ class CardsObject(FoundationObject):
return self.scryfallJson['edhrec_rank'] return self.scryfallJson['edhrec_rank']
def prices(self, mode): def prices(self, mode):
"""Returns prices from modes `usd`, `usd_foil`, `eur`, and `tix` """Returns prices from modes `usd`, `usd_foil`, `usd_etched`, `usd_glossy`, `eur`, and `tix`
Args: Args:
mode (string): The prices to get mode (string): The prices to get
@ -473,7 +484,7 @@ class CardsObject(FoundationObject):
Returns: Returns:
float: The prices as a float float: The prices as a float
""" """
modes = ['usd', 'usd_foil', 'eur', 'tix'] modes = ['usd', 'usd_foil', 'usd_etched', 'usd_glossy', 'eur', 'tix']
if mode not in modes: if mode not in modes:
raise KeyError("{} is not a key.".format(mode)) raise KeyError("{} is not a key.".format(mode))
@ -672,23 +683,31 @@ class CardsObject(FoundationObject):
return self.scryfallJson['oracle_id'] return self.scryfallJson['oracle_id']
def foil(self): def foil(self):
"""True if this printing exists in a foil version """True if this printing exists in a foil version.
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
""" """
super(CardsObject, self)._checkForKey('foil') super(CardsObject, self)._checkForKey('foil')
print('WARNING: This method will be deprecated on Nov 1, 2021. Please use the `finishes` method instead.')
return self.scryfallJson['foil'] return self.scryfallJson['foil']
def nonfoil(self): def nonfoil(self):
"""True if this printing does not exist in foil """True if this printing does not exist in foil
DEPRECATION NOTICE: This method will be deprecated on Nov 1, 2021.
Returns: Returns:
boolean boolean
""" """
super(CardsObject, self)._checkForKey('nonfoil') super(CardsObject, self)._checkForKey('nonfoil')
print('WARNING: This method will be deprecated on Nov 1, 2021. Please use the `finishes` method instead.')
return self.scryfallJson['nonfoil'] return self.scryfallJson['nonfoil']
def oversized(self): def oversized(self):
@ -759,3 +778,14 @@ class CardsObject(FoundationObject):
super(CardsObject, self)._checkForKey('image_status') super(CardsObject, self)._checkForKey('image_status')
return self.scryfallJson['image_status'] return self.scryfallJson['image_status']
def finishes(self):
"""A list of computer-readable flags that indicate if this card
can come in foil, nonfoil, etched, or glossy finishes.
Returns:
list: A list of all finishes.
"""
super(CardsObject, self)._checkForKey('finishes')
return self.scryfallJson['finishes']

View File

@ -18,6 +18,8 @@ vanguard = Id(id='87c1234b-3834-4bba-bef2-05707bb1e8e2'); time.sleep(0.1)
alt_lang_card = Collector(code='ths', collector_number='75', lang='ja'); time.sleep(0.1) alt_lang_card = Collector(code='ths', collector_number='75', lang='ja'); time.sleep(0.1)
planeswalker = Id(id='4c565076-5db2-47ea-8ee0-4a4fd7bb353d'); time.sleep(0.1) planeswalker = Id(id='4c565076-5db2-47ea-8ee0-4a4fd7bb353d'); time.sleep(0.1)
preview_check = Id(id='fb6b12e7-bb93-4eb6-bad1-b256a6ccff4e'); time.sleep(0.1) preview_check = Id(id='fb6b12e7-bb93-4eb6-bad1-b256a6ccff4e'); time.sleep(0.1)
meld_card = Id(id='5a7a212e-e0b6-4f12-a95c-173cae023f93'); time.sleep(0.1)
foil_etched = Id(id='47f44d5a-f3d6-4a9a-8bd3-b17a88565c51'); time.sleep(0.1)
autocomplete = Autocomplete(q='Thal'); time.sleep(0.1) autocomplete = Autocomplete(q='Thal'); time.sleep(0.1)
@ -158,7 +160,7 @@ class TestCardObjects(unittest.TestCase):
self.assertIsInstance(transform.color_indicator(1), list) self.assertIsInstance(transform.color_indicator(1), list)
def test_all_parts(self): def test_all_parts(self):
self.assertIsInstance(transform.all_parts(), list) self.assertIsInstance(meld_card.all_parts(), list)
def non_online_card_faces(self): def non_online_card_faces(self):
self.assertIsInstance(transform.card_faces(), list) self.assertIsInstance(transform.card_faces(), list)
@ -196,15 +198,9 @@ class TestCardObjects(unittest.TestCase):
def test_oracle_id(self): def test_oracle_id(self):
self.assertIsInstance(non_online_card.oracle_id(), str) self.assertIsInstance(non_online_card.oracle_id(), str)
def test_foil(self):
self.assertIsInstance(non_online_card.foil(), bool)
def test_loyalty(self): def test_loyalty(self):
self.assertIsInstance(planeswalker.loyalty(), str) self.assertIsInstance(planeswalker.loyalty(), str)
def test_non_foil(self):
self.assertIsInstance(non_online_card.nonfoil(), bool)
def test_oversized(self): def test_oversized(self):
self.assertIsInstance(non_online_card.oversized(), bool) self.assertIsInstance(non_online_card.oversized(), bool)
@ -215,6 +211,27 @@ class TestCardObjects(unittest.TestCase):
def test_image_status(self): def test_image_status(self):
self.assertIsInstance(non_online_card.image_status(), str) self.assertIsInstance(non_online_card.image_status(), str)
def test_finishes(self):
self.assertIsInstance(foil_etched.finishes(), list)
def test_tcgplayer_id(self):
self.assertIsInstance(non_online_card.tcgplayer_id(), int)
def test_tcgplayer_etched_id(self):
self.assertIsInstance(foil_etched.tcgplayer_etched_id(), int)
def test_frame_effects(self):
self.assertIsInstance(frame_effected_card.frame_effects(), list)
def test_games(self):
self.assertIsInstance(non_online_card.games(), list)
def test_promo(self):
self.assertIsInstance(non_online_card.promo(), bool)
def test_released_at(self):
self.assertIsInstance(non_online_card.released_at(), str)
class TestAutocomplete(unittest.TestCase): class TestAutocomplete(unittest.TestCase):
def test_object(self): def test_object(self):
@ -246,21 +263,6 @@ class TestSearch(unittest.TestCase):
def test_data_length(self): def test_data_length(self):
self.assertIsInstance(search.data_length(), int) self.assertIsInstance(search.data_length(), int)
def test_tcgplayer_id(self):
self.assertIsInstance(non_online_card.tcgplayer_id(), int)
def test_frame_effects(self):
self.assertIsInstance(frame_effected_card.frame_effects(), list)
def test_games(self):
self.assertIsInstance(non_online_card.games(), list)
def test_promo(self):
self.assertIsInstance(non_online_card.promo(), bool)
def test_released_at(self):
self.assertIsInstance(non_online_card.released_at(), str)
if __name__ == '__main__': if __name__ == '__main__':
test_classes_to_run = [ test_classes_to_run = [