From 15967521f3a5d5db377f783d09810a2abd94c7ec Mon Sep 17 00:00:00 2001 From: Nanda Scott Date: Wed, 21 Feb 2018 18:13:55 -0500 Subject: [PATCH] Added docstrings to Catalogs. --- scrython/catalog/artifact_types.py | 18 ++++++++++++++++++ scrython/catalog/card_names.py | 18 ++++++++++++++++++ scrython/catalog/catalogs_object.py | 16 ++++++++++++++++ scrython/catalog/creature_types.py | 18 ++++++++++++++++++ scrython/catalog/land_types.py | 18 ++++++++++++++++++ scrython/catalog/loyalties.py | 18 ++++++++++++++++++ scrython/catalog/planeswalker_types.py | 18 ++++++++++++++++++ scrython/catalog/powers.py | 18 ++++++++++++++++++ scrython/catalog/spell_types.py | 18 ++++++++++++++++++ scrython/catalog/toughnesses.py | 18 ++++++++++++++++++ scrython/catalog/watermarks.py | 18 ++++++++++++++++++ scrython/catalog/word_bank.py | 18 ++++++++++++++++++ 12 files changed, 214 insertions(+) diff --git a/scrython/catalog/artifact_types.py b/scrython/catalog/artifact_types.py index ffe7198..1925f25 100644 --- a/scrython/catalog/artifact_types.py +++ b/scrython/catalog/artifact_types.py @@ -1,6 +1,24 @@ from .catalogs_object import CatalogsObject class ArtifactTypes(CatalogsObject): + """ + catalogs/artifact-types + + 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() + """ def __init__(self): self._url = 'catalog/artifact-types?' super(ArtifactTypes, self).__init__(self._url) diff --git a/scrython/catalog/card_names.py b/scrython/catalog/card_names.py index 18f2c57..16a513c 100644 --- a/scrython/catalog/card_names.py +++ b/scrython/catalog/card_names.py @@ -1,6 +1,24 @@ from .catalogs_object import CatalogsObject class CardNames(CatalogsObject): + """ + catalogs/card-names + + 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() + """ def __init__(self): self._url = 'catalog/card-names?' super(CardNames, self).__init__(self._url) diff --git a/scrython/catalog/catalogs_object.py b/scrython/catalog/catalogs_object.py index 3979456..533e64a 100644 --- a/scrython/catalog/catalogs_object.py +++ b/scrython/catalog/catalogs_object.py @@ -3,6 +3,22 @@ import aiohttp import urllib.parse 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. + """ def __init__(self, _url, **kwargs): self.params = {'format': kwargs.get('format', 'json'), 'pretty': kwargs.get('pretty', '')} diff --git a/scrython/catalog/creature_types.py b/scrython/catalog/creature_types.py index fad46c5..a1b95e0 100644 --- a/scrython/catalog/creature_types.py +++ b/scrython/catalog/creature_types.py @@ -1,6 +1,24 @@ from .catalogs_object import CatalogsObject class CreatureTypes(CatalogsObject): + """ + catalogs/creature-types + + 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() + """ def __init__(self): self._url = 'catalog/creature-types?' super(CreatureTypes, self).__init__(self._url) diff --git a/scrython/catalog/land_types.py b/scrython/catalog/land_types.py index de13df9..7938f17 100644 --- a/scrython/catalog/land_types.py +++ b/scrython/catalog/land_types.py @@ -1,6 +1,24 @@ from .catalogs_object import CatalogsObject class LandTypes(CatalogsObject): + """ + catalogs/land-types + + 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() + """ def __init__(self): self._url = 'catalog/land-types?' super(LandTypes, self).__init__(self._url) diff --git a/scrython/catalog/loyalties.py b/scrython/catalog/loyalties.py index e9b6078..4d209b4 100644 --- a/scrython/catalog/loyalties.py +++ b/scrython/catalog/loyalties.py @@ -1,6 +1,24 @@ from .catalogs_object import CatalogsObject class Loyalties(CatalogsObject): + """ + catalogs/loyalties + + 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() + """ def __init__(self): self._url = 'catalog/loyalties?' super(Loyalties, self).__init__(self._url) diff --git a/scrython/catalog/planeswalker_types.py b/scrython/catalog/planeswalker_types.py index 345dc72..20c7dfc 100644 --- a/scrython/catalog/planeswalker_types.py +++ b/scrython/catalog/planeswalker_types.py @@ -1,6 +1,24 @@ from .catalogs_object import CatalogsObject class PlaneswalkerTypes(CatalogsObject): + """ + catalogs/planeswalker-types + + 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() + """ def __init__(self): self._url = 'catalog/planeswalker-types?' super(PlaneswalkerTypes, self).__init__(self._url) diff --git a/scrython/catalog/powers.py b/scrython/catalog/powers.py index 1a88efe..d6ed420 100644 --- a/scrython/catalog/powers.py +++ b/scrython/catalog/powers.py @@ -1,6 +1,24 @@ from .catalogs_object import CatalogsObject class Powers(CatalogsObject): + """ + catalogs/powers + + 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() + """ def __init__(self): self._url = 'catalog/powers?' super(Powers, self).__init__(self._url) diff --git a/scrython/catalog/spell_types.py b/scrython/catalog/spell_types.py index 8208752..c62e427 100644 --- a/scrython/catalog/spell_types.py +++ b/scrython/catalog/spell_types.py @@ -1,6 +1,24 @@ from .catalogs_object import CatalogsObject 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 + + Example usage: + >>> catalog = scrython.catalog.SpellTypes() + >>> catalog.data() + """ def __init__(self): self._url = 'catalog/spell-types?' super(SpellTypes, self).__init__(self._url) diff --git a/scrython/catalog/toughnesses.py b/scrython/catalog/toughnesses.py index 2d84097..e39813d 100644 --- a/scrython/catalog/toughnesses.py +++ b/scrython/catalog/toughnesses.py @@ -1,6 +1,24 @@ from .catalogs_object import CatalogsObject class Toughnesses(CatalogsObject): + """ + catalogs/toughnesses + + 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() + """ def __init__(self): self._url = 'catalog/toughnesses?' super(Toughnesses, self).__init__(self._url) diff --git a/scrython/catalog/watermarks.py b/scrython/catalog/watermarks.py index 8e29d0e..de5600b 100644 --- a/scrython/catalog/watermarks.py +++ b/scrython/catalog/watermarks.py @@ -1,6 +1,24 @@ from .catalogs_object import CatalogsObject class Watermarks(CatalogsObject): + """ + catalogs/watermarks + + 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() + """ def __init__(self): self._url = 'catalog/watermarks?' super(Watermarks, self).__init__(self._url) diff --git a/scrython/catalog/word_bank.py b/scrython/catalog/word_bank.py index 50fd001..7d1f353 100644 --- a/scrython/catalog/word_bank.py +++ b/scrython/catalog/word_bank.py @@ -1,6 +1,24 @@ from .catalogs_object import CatalogsObject class WordBank(CatalogsObject): + """ + catalogs/word-bank + + 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() + """ def __init__(self): self._url = 'catalog/word-bank?' super(WordBank, self).__init__(self._url)