Updated docs and docstrings for Search. Also formatting.

This commit is contained in:
2018-03-24 18:27:04 -04:00
parent f80c7b15c8
commit 23265385fd
2 changed files with 16 additions and 0 deletions

View File

@ -5,6 +5,7 @@ Documentation for a card object. These docs will likely not be as detailed as th
>In the event that a key isn't found or has been changed, you can access the full JSON output with the `scryfallJson` variable (`card.scryfallJson`). >In the event that a key isn't found or has been changed, you can access the full JSON output with the `scryfallJson` variable (`card.scryfallJson`).
## Attributes ## Attributes
All attributes are listed assuming the following All attributes are listed assuming the following
`card = scrython.cards.<Class>()` is the current usage. `card = scrython.cards.<Class>()` is the current usage.
@ -65,6 +66,7 @@ All attributes are listed assuming the following
|`card.flavor_text()`|String| The flavor text of the card, if any. |`card.flavor_text()`|String| The flavor text of the card, if any.
## *class* `cards.Named()` ## *class* `cards.Named()`
Gets a card by the name. Gets a card by the name.
**Parameters:** **Parameters:**
@ -78,12 +80,14 @@ Gets a card by the name.
>Since the `/cards/named` endpoint specifically requires the fuzzy or exact markers, they are required to be explicitly denoted. >Since the `/cards/named` endpoint specifically requires the fuzzy or exact markers, they are required to be explicitly denoted.
## *class* `cards.Random()` ## *class* `cards.Random()`
Get a random card. Get a random card.
**Parameters:** **Parameters:**
No parameters are required. No parameters are required.
## *class* `cards.Multiverse()` ## *class* `cards.Multiverse()`
Get a card by Multiverse id Get a card by Multiverse id
**Parameters:** **Parameters:**
@ -93,6 +97,7 @@ Get a card by Multiverse id
|id|Yes|Integer or String| This is the associated multiverse id of the given card. |id|Yes|Integer or String| This is the associated multiverse id of the given card.
## *class* `cards.Mtgo()` ## *class* `cards.Mtgo()`
Get a card by MTGO id. Get a card by MTGO id.
**Parameters:** **Parameters:**
@ -102,6 +107,7 @@ Get a card by MTGO id.
|id|Yes|String|The required mtgo id of the card. |id|Yes|String|The required mtgo id of the card.
## *class* `cards.Collector()` ## *class* `cards.Collector()`
Get a card by collector number. Get a card by collector number.
**Parameters:** **Parameters:**
@ -112,6 +118,7 @@ Get a card by collector number.
|collector_number|Yes|String|This is the collector number of the card.| |collector_number|Yes|String|This is the collector number of the card.|
## *class* `cards.Id()` ## *class* `cards.Id()`
Get a card by the Scryfall id. Get a card by the Scryfall id.
**Parameters:** **Parameters:**
@ -121,6 +128,7 @@ Get a card by the Scryfall id.
|id|Yes|String|The Scryfall Id of the card.| |id|Yes|String|The Scryfall Id of the card.|
## *class* `cards.Autocomplete()` ## *class* `cards.Autocomplete()`
Get a list of potential autocompletion phrases. Get a list of potential autocompletion phrases.
**Parameters:** **Parameters:**
@ -138,6 +146,7 @@ Get a list of potential autocompletion phrases.
|`data()`|List|The list of potential autocompletes.| |`data()`|List|The list of potential autocompletes.|
## *class* `cards.Search()` ## *class* `cards.Search()`
Uses a search query to gather relevant data. Uses a search query to gather relevant data.
**Parameters:** **Parameters:**
@ -160,3 +169,6 @@ Uses a search query to gather relevant data.
|`data()`|List|The list of potential autocompletes.| |`data()`|List|The list of potential autocompletes.|
|`has_more()`|Boolean|True if there is more than 1 page of results.| |`has_more()`|Boolean|True if there is more than 1 page of results.|
|`next_page()`|String|The API URI to the next page of the query.| |`next_page()`|String|The API URI to the next page of the query.|
|`warnings()`|List| Provides an array of errors, if any.|
|`data_length()`|Integer| The length of the data returned.|
|`data_tuple()`|Dict| Accesses an object at the specified index.|

View File

@ -24,6 +24,10 @@ class Search(CardsObject):
data : list ...................... The list of potential autocompletes. data : list ...................... The list of potential autocompletes.
has_more : bool ......... True if there is more than 1 page of results. has_more : bool ......... True if there is more than 1 page of results.
next_page : str ............ The API URI to the next page of the query. next_page : str ............ The API URI to the next page of the query.
warnings : list .................. Provides an array of errors, if any.
data_length : int .................... The length of the data returned.
data_tuple : dict .......... Accesses an object at the specified index.
Example usage: Example usage:
>>> search = scrython.cards.Search(q="++e:A25", order="spoiled") >>> search = scrython.cards.Search(q="++e:A25", order="spoiled")