Scrython/Autocomplete.md

65 lines
1.7 KiB
Markdown
Raw Normal View History

2018-10-28 02:54:47 +00:00
# **class** `Autocomplete()`
These docs will likely not be as detailed as the official Scryfall Documentation, and you should reference that for more information.
>In the event that a key isn't found or has been changed, you can access the full JSON output with the `scryfallJson` variable (`Autocomplete().scryfallJson`).
## Args
|arg|type|description|
2018-10-28 02:56:57 +00:00
|:---:|:---:|:---:|
|q|string|The query of the autocompletion.|
2018-10-28 02:54:47 +00:00
|format|string, optional|Defaults to \'json\'. Returns data in the specified method.|
|face|string, optional|Defaults to empty string. If you\'re using the `image` format, this will specify if you want the front or back face.|
|version|string, optional|Defaults to empty string. If you\'re using the `image` format, this will specify if you want the small, normal, large, etc version of the image.|
|pretty|string, optional|Defaults to empty string. Returns a prettier version of the json object. Note that this may break functionality with Scrython.|
## Returns
N/A
## Raises
|exception type|reason|
2018-10-28 02:56:57 +00:00
|:---:|:---:|
|Exception|If the \'q\' parameter is not provided.|
2018-10-28 02:54:47 +00:00
|Exception|If the object returned is an error.|
## Examples
2018-10-28 04:32:06 +00:00
```python
2018-10-28 02:54:47 +00:00
>>> auto = scrython.cards.Autocomplete(q="Thal")
>>> auto.total_items()
2018-10-28 04:24:33 +00:00
```
## Methods
2018-10-28 04:32:06 +00:00
---
2018-10-28 04:33:03 +00:00
### `object()`
2018-10-28 04:24:33 +00:00
2018-10-28 04:28:00 +00:00
```
2018-10-28 04:24:33 +00:00
Returns the type of object it is.
(card, error, etc)
Returns:
string: The type of object
2018-10-28 04:28:00 +00:00
```
2018-10-28 04:32:06 +00:00
---
2018-10-28 04:33:03 +00:00
### `total_values()`
2018-10-28 04:29:24 +00:00
```
How many items are returned in `data`
Returns:
int: The number of items in the `data` key
```
2018-10-28 04:32:06 +00:00
---
2018-10-28 04:33:03 +00:00
### `data()`
2018-10-28 04:29:24 +00:00
```
The list of potential autocompletes
Returns:
list: A list of possible corrections
```