Added docstrings to Catalogs.

This commit is contained in:
Nanda Scott 2018-02-21 18:13:55 -05:00
parent 64dbd8678a
commit 15967521f3
12 changed files with 214 additions and 0 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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', '')}

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)