From cdda608ad6fbe3030d9b87ab092bd4b54c401a23 Mon Sep 17 00:00:00 2001 From: Nanda Scott Date: Tue, 23 Oct 2018 22:43:36 -0400 Subject: [PATCH] Updated docs for catalogs --- scrython/catalog/artifact_types.py | 9 ------ scrython/catalog/artist_names.py | 9 ------ scrython/catalog/card_names.py | 9 ------ scrython/catalog/catalogs_object.py | 41 ++++++++++++++++++-------- scrython/catalog/creature_types.py | 9 ------ scrython/catalog/enchantment_types.py | 9 ------ scrython/catalog/land_types.py | 9 ------ scrython/catalog/loyalties.py | 9 ------ scrython/catalog/planeswalker_types.py | 9 ------ scrython/catalog/powers.py | 9 ------ scrython/catalog/spell_types.py | 11 +------ scrython/catalog/toughnesses.py | 9 ------ scrython/catalog/watermarks.py | 9 ------ scrython/catalog/word_bank.py | 9 ------ 14 files changed, 30 insertions(+), 130 deletions(-) diff --git a/scrython/catalog/artifact_types.py b/scrython/catalog/artifact_types.py index 1925f25..16435b8 100644 --- a/scrython/catalog/artifact_types.py +++ b/scrython/catalog/artifact_types.py @@ -6,15 +6,6 @@ class ArtifactTypes(CatalogsObject): Catalog object for all known artifact types - Positional Arguments: - No arguments are required. - - Optional Arguments: - All arguments are inherited from CatalogsObject - - Attributes: - All attributes are inherited from CatalogsObject - Example usage: >>> catalog = scrython.catalog.ArtifactTypes() >>> catalog.data() diff --git a/scrython/catalog/artist_names.py b/scrython/catalog/artist_names.py index 2e10e3f..d60a391 100644 --- a/scrython/catalog/artist_names.py +++ b/scrython/catalog/artist_names.py @@ -6,15 +6,6 @@ class ArtistNames(CatalogsObject): Catalog object for all known card names. - Positional Arguments: - No arguments are required. - - Optional Arguments: - All arguments are inherited from CatalogsObject - - Attributes: - All attributes are inherited from CatalogsObject - Example usage: >>> catalog = scrython.catalog.CardNames() >>> catalog.data() diff --git a/scrython/catalog/card_names.py b/scrython/catalog/card_names.py index 16a513c..60c521c 100644 --- a/scrython/catalog/card_names.py +++ b/scrython/catalog/card_names.py @@ -6,15 +6,6 @@ class CardNames(CatalogsObject): Catalog object for all known card names. - Positional Arguments: - No arguments are required. - - Optional Arguments: - All arguments are inherited from CatalogsObject - - Attributes: - All attributes are inherited from CatalogsObject - Example usage: >>> catalog = scrython.catalog.CardNames() >>> catalog.data() diff --git a/scrython/catalog/catalogs_object.py b/scrython/catalog/catalogs_object.py index 4c90dc1..c25a280 100644 --- a/scrython/catalog/catalogs_object.py +++ b/scrython/catalog/catalogs_object.py @@ -7,18 +7,14 @@ class CatalogsObject(object): """ Master object for all catalog objects. - Positional Arguments: - No arguments are required. - - Optional Arguments: - format : str ................... The format to return. Defaults to JSON. - pretty : bool ... Makes the returned JSON prettier. The library may not work properly with this setting. - - Attributes: - object : str ...... Returns the type of object it is. (card, error, etc) - uri : str .................. The API URI for the endpoint you've called. - total_values : int ..................... The number of items in `data()` - data : list .............. A list of all types returned by the endpoint. + Args: + format (string, optional): + Defaults to 'json'. + Returns data in the specified method. + pretty (string, optional): + Defaults to empty string. + Returns a prettier version of the json object. + Note that this may break functionality with Scrython. """ def __init__(self, _url, **kwargs): self.params = {'format': kwargs.get('format', 'json'), 'pretty': kwargs.get('pretty', '')} @@ -50,21 +46,42 @@ class CatalogsObject(object): raise KeyError('This card has no key \'{}\''.format(key)) def object(self): + """Returns the type of object it is + (card, error, etc) + + Returns: + string + """ self._checkForKey('object') return self.scryfallJson['object'] def uri(self): + """The API URI for the endpoint you've called. + + Returns: + string + """ self._checkForKey('uri') return self.scryfallJson['uri'] def total_values(self): + """The number of items in `data()` + + Returns: + integer + """ self._checkForKey('total_values') return self.scryfallJson['total_values'] def data(self): + """A list of all types returned by the endpoint + + Returns: + list + """ self._checkForKey('data') return self.scryfallJson['data'] diff --git a/scrython/catalog/creature_types.py b/scrython/catalog/creature_types.py index a1b95e0..1b54020 100644 --- a/scrython/catalog/creature_types.py +++ b/scrython/catalog/creature_types.py @@ -6,15 +6,6 @@ class CreatureTypes(CatalogsObject): Catalog object for all known creature types. - Positional Arguments: - No arguments are required. - - Optional Arguments: - All arguments are inherited from CatalogsObject - - Attributes: - All attributes are inherited from CatalogsObject - Example usage: >>> catalog = scrython.catalog.CreatureTypes() >>> catalog.data() diff --git a/scrython/catalog/enchantment_types.py b/scrython/catalog/enchantment_types.py index 1af0ad8..b20aca6 100644 --- a/scrython/catalog/enchantment_types.py +++ b/scrython/catalog/enchantment_types.py @@ -6,15 +6,6 @@ class EnchantmentTypes(CatalogsObject): Catalog object for all known enchantment types. - Positional Arguments: - No arguments are required. - - Optional Arguments: - All arguments are inherited from CatalogsObject - - Attributes: - All attributes are inherited from CatalogsObject - Example usage: >>> catalog = scrython.catalog.EnchantmentTypes() >>> catalog.data() diff --git a/scrython/catalog/land_types.py b/scrython/catalog/land_types.py index 7938f17..ade9b54 100644 --- a/scrython/catalog/land_types.py +++ b/scrython/catalog/land_types.py @@ -6,15 +6,6 @@ class LandTypes(CatalogsObject): Catalog object for all known land types. - Positional Arguments: - No arguments are required. - - Optional Arguments: - All arguments are inherited from CatalogsObject - - Attributes: - All attributes are inherited from CatalogsObject - Example usage: >>> catalog = scrython.catalog.LandTypes() >>> catalog.data() diff --git a/scrython/catalog/loyalties.py b/scrython/catalog/loyalties.py index 4d209b4..a8b0aab 100644 --- a/scrython/catalog/loyalties.py +++ b/scrython/catalog/loyalties.py @@ -6,15 +6,6 @@ class Loyalties(CatalogsObject): Catalog object for all known starting loyalties. - Positional Arguments: - No arguments are required. - - Optional Arguments: - All arguments are inherited from CatalogsObject - - Attributes: - All attributes are inherited from CatalogsObject - Example usage: >>> catalog = scrython.catalog.Loyalties() >>> catalog.data() diff --git a/scrython/catalog/planeswalker_types.py b/scrython/catalog/planeswalker_types.py index 20c7dfc..a275dd5 100644 --- a/scrython/catalog/planeswalker_types.py +++ b/scrython/catalog/planeswalker_types.py @@ -6,15 +6,6 @@ class PlaneswalkerTypes(CatalogsObject): Catalog object for all known planeswalker types. - Positional Arguments: - No arguments are required. - - Optional Arguments: - All arguments are inherited from CatalogsObject - - Attributes: - All attributes are inherited from CatalogsObject - Example usage: >>> catalog = scrython.catalog.PlaneswalkerTypes() >>> catalog.data() diff --git a/scrython/catalog/powers.py b/scrython/catalog/powers.py index d6ed420..d64fe96 100644 --- a/scrython/catalog/powers.py +++ b/scrython/catalog/powers.py @@ -6,15 +6,6 @@ class Powers(CatalogsObject): Catalog object for all known powers. - Positional Arguments: - No arguments are required. - - Optional Arguments: - All arguments are inherited from CatalogsObject - - Attributes: - All attributes are inherited from CatalogsObject - Example usage: >>> catalog = scrython.catalog.Powers() >>> catalog.data() diff --git a/scrython/catalog/spell_types.py b/scrython/catalog/spell_types.py index c62e427..b3682c8 100644 --- a/scrython/catalog/spell_types.py +++ b/scrython/catalog/spell_types.py @@ -4,16 +4,7 @@ class SpellTypes(CatalogsObject): """ catalogs/spell-types - Catalog object for all known spell types - - Positional Arguments: - No arguments are required. - - Optional Arguments: - All arguments are inherited from CatalogsObject - - Attributes: - All attributes are inherited from CatalogsObject + Catalog object for all known spell types. Example usage: >>> catalog = scrython.catalog.SpellTypes() diff --git a/scrython/catalog/toughnesses.py b/scrython/catalog/toughnesses.py index e39813d..7efa724 100644 --- a/scrython/catalog/toughnesses.py +++ b/scrython/catalog/toughnesses.py @@ -6,15 +6,6 @@ class Toughnesses(CatalogsObject): Catalog object for all known toughnesses. - Positional Arguments: - No arguments are required. - - Optional Arguments: - All arguments are inherited from CatalogsObject - - Attributes: - All attributes are inherited from CatalogsObject - Example usage: >>> catalog = scrython.catalog.Toughnesses() >>> catalog.data() diff --git a/scrython/catalog/watermarks.py b/scrython/catalog/watermarks.py index de5600b..300621c 100644 --- a/scrython/catalog/watermarks.py +++ b/scrython/catalog/watermarks.py @@ -6,15 +6,6 @@ class Watermarks(CatalogsObject): Catalog object for all known watermarks. - Positional Arguments: - No arguments are required. - - Optional Arguments: - All arguments are inherited from CatalogsObject - - Attributes: - All attributes are inherited from CatalogsObject - Example usage: >>> catalog = scrython.catalog.Watermarks() >>> catalog.data() diff --git a/scrython/catalog/word_bank.py b/scrython/catalog/word_bank.py index 7d1f353..d81aca4 100644 --- a/scrython/catalog/word_bank.py +++ b/scrython/catalog/word_bank.py @@ -6,15 +6,6 @@ class WordBank(CatalogsObject): Catalog object for all known words on all cards. - Positional Arguments: - No arguments are required. - - Optional Arguments: - All arguments are inherited from CatalogsObject - - Attributes: - All attributes are inherited from CatalogsObject - Example usage: >>> catalog = scrython.catalog.WordBank() >>> catalog.data()