From 23265385fd6ed523ee9cfa6e772b3f07b9b2ac5b Mon Sep 17 00:00:00 2001 From: Date: Sat, 24 Mar 2018 18:27:04 -0400 Subject: [PATCH] Updated docs and docstrings for Search. Also formatting. --- docs/Cards.md | 12 ++++++++++++ scrython/cards/search.py | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/docs/Cards.md b/docs/Cards.md index b619062..612f207 100644 --- a/docs/Cards.md +++ b/docs/Cards.md @@ -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`). ## Attributes + All attributes are listed assuming the following `card = scrython.cards.()` 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. ## *class* `cards.Named()` + Gets a card by the name. **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. ## *class* `cards.Random()` + Get a random card. **Parameters:** No parameters are required. ## *class* `cards.Multiverse()` + Get a card by Multiverse id **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. ## *class* `cards.Mtgo()` + Get a card by MTGO id. **Parameters:** @@ -102,6 +107,7 @@ Get a card by MTGO id. |id|Yes|String|The required mtgo id of the card. ## *class* `cards.Collector()` + Get a card by collector number. **Parameters:** @@ -112,6 +118,7 @@ Get a card by collector number. |collector_number|Yes|String|This is the collector number of the card.| ## *class* `cards.Id()` + Get a card by the Scryfall id. **Parameters:** @@ -121,6 +128,7 @@ Get a card by the Scryfall id. |id|Yes|String|The Scryfall Id of the card.| ## *class* `cards.Autocomplete()` + Get a list of potential autocompletion phrases. **Parameters:** @@ -138,6 +146,7 @@ Get a list of potential autocompletion phrases. |`data()`|List|The list of potential autocompletes.| ## *class* `cards.Search()` + Uses a search query to gather relevant data. **Parameters:** @@ -160,3 +169,6 @@ Uses a search query to gather relevant data. |`data()`|List|The list of potential autocompletes.| |`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.| +|`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.| \ No newline at end of file diff --git a/scrython/cards/search.py b/scrython/cards/search.py index 5d0062e..9512f50 100644 --- a/scrython/cards/search.py +++ b/scrython/cards/search.py @@ -24,6 +24,10 @@ class Search(CardsObject): data : list ...................... The list of potential autocompletes. 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. + 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: >>> search = scrython.cards.Search(q="++e:A25", order="spoiled")