-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from Tsukalos/master
Added new classes to fetch keywords and ability words from catalog on the API
- Loading branch information
Showing
8 changed files
with
291 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# **class** `scrython.catalog.AbilityWords()` | ||
|
||
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 (`AbilityWords().scryfallJson`). | ||
## Args | ||
|
||
|arg|type|description| | ||
|:---:|:---:|:---:| | ||
|
||
## Returns | ||
N/A | ||
|
||
## Raises | ||
N/A | ||
|
||
## Examples | ||
```python | ||
>>> catalog = scrython.catalog.KeywordAbilities() | ||
>>> catalog.data() | ||
``` | ||
|
||
## Methods | ||
|
||
--- | ||
### `data()` | ||
|
||
``` | ||
A list of all types returned by the endpoint | ||
Returns: | ||
list | ||
``` | ||
--- | ||
### `object()` | ||
|
||
``` | ||
Returns the type of object it is | ||
(card, error, etc) | ||
Returns: | ||
string | ||
``` | ||
--- | ||
### `total_values()` | ||
|
||
``` | ||
The number of items in `data()` | ||
Returns: | ||
integer | ||
``` | ||
--- | ||
### `uri()` | ||
|
||
``` | ||
The API URI for the endpoint you've called. | ||
Returns: | ||
string | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# **class** `scrython.catalog.KeywordAbilities()` | ||
|
||
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 (`KeywordAbilities().scryfallJson`). | ||
## Args | ||
|
||
|arg|type|description| | ||
|:---:|:---:|:---:| | ||
|
||
## Returns | ||
N/A | ||
|
||
## Raises | ||
N/A | ||
|
||
## Examples | ||
```python | ||
>>> catalog = scrython.catalog.KeywordAbilities() | ||
>>> catalog.data() | ||
``` | ||
|
||
## Methods | ||
|
||
--- | ||
### `data()` | ||
|
||
``` | ||
A list of all types returned by the endpoint | ||
Returns: | ||
list | ||
``` | ||
--- | ||
### `object()` | ||
|
||
``` | ||
Returns the type of object it is | ||
(card, error, etc) | ||
Returns: | ||
string | ||
``` | ||
--- | ||
### `total_values()` | ||
|
||
``` | ||
The number of items in `data()` | ||
Returns: | ||
integer | ||
``` | ||
--- | ||
### `uri()` | ||
|
||
``` | ||
The API URI for the endpoint you've called. | ||
Returns: | ||
string | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# **class** `scrython.catalog.KeywordActions()` | ||
|
||
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 (`KeywordActions().scryfallJson`). | ||
## Args | ||
|
||
|arg|type|description| | ||
|:---:|:---:|:---:| | ||
|
||
## Returns | ||
N/A | ||
|
||
## Raises | ||
N/A | ||
|
||
## Examples | ||
```python | ||
>>> catalog = scrython.catalog.KeywordActions() | ||
>>> catalog.data() | ||
``` | ||
|
||
## Methods | ||
|
||
--- | ||
### `data()` | ||
|
||
``` | ||
A list of all types returned by the endpoint | ||
Returns: | ||
list | ||
``` | ||
--- | ||
### `object()` | ||
|
||
``` | ||
Returns the type of object it is | ||
(card, error, etc) | ||
Returns: | ||
string | ||
``` | ||
--- | ||
### `total_values()` | ||
|
||
``` | ||
The number of items in `data()` | ||
Returns: | ||
integer | ||
``` | ||
--- | ||
### `uri()` | ||
|
||
``` | ||
The API URI for the endpoint you've called. | ||
Returns: | ||
string | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from .catalogs_object import CatalogsObject | ||
|
||
|
||
class AbilityWords(CatalogsObject): | ||
""" | ||
catalogs/ability-words | ||
Catalog object for all known ability words | ||
Args: | ||
N/A | ||
Returns: | ||
N/A | ||
Raises: | ||
N/A | ||
Examples: | ||
>>> catalog = scrython.catalog.KeywordAbilities() | ||
>>> catalog.data() | ||
""" | ||
|
||
def __init__(self): | ||
self._url = 'catalog/ability-words?' | ||
super(AbilityWords, self).__init__(self._url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from .catalogs_object import CatalogsObject | ||
|
||
|
||
class KeywordAbilities(CatalogsObject): | ||
""" | ||
catalog/keyword-abilities | ||
Catalog object for all known keyword abilities | ||
Args: | ||
N/A | ||
Returns: | ||
N/A | ||
Raises: | ||
N/A | ||
Examples: | ||
>>> catalog = scrython.catalog.KeywordAbilities() | ||
>>> catalog.data() | ||
""" | ||
|
||
def __init__(self): | ||
self._url = 'catalog/keyword-abilities?' | ||
super(KeywordAbilities, self).__init__(self._url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from .catalogs_object import CatalogsObject | ||
|
||
|
||
class KeywordActions(CatalogsObject): | ||
""" | ||
catalog/keyword-actions | ||
Catalog object for all known keyword actions | ||
Args: | ||
N/A | ||
Returns: | ||
N/A | ||
Raises: | ||
N/A | ||
Examples: | ||
>>> catalog = scrython.catalog.KeywordActions() | ||
>>> catalog.data() | ||
""" | ||
|
||
def __init__(self): | ||
self._url = 'catalog/keyword-actions?' | ||
super(KeywordActions, self).__init__(self._url) |