Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new classes to fetch keywords and ability words from catalog on the API #79

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions docs/scrython.catalog/AbilityWords.md
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

```
66 changes: 66 additions & 0 deletions docs/scrython.catalog/KeywordAbilities.md
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

```
66 changes: 66 additions & 0 deletions docs/scrython.catalog/KeywordActions.md
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

```
7 changes: 7 additions & 0 deletions scrython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
from scrython.catalog import Watermarks
from scrython.catalog import WordBank
from scrython.catalog import ArtistNames
from scrython.catalog import KeywordAbilities
from scrython.catalog import KeywordActions
from scrython.catalog import AbilityWords


#Import symbology
from scrython.symbology import ParseMana
Expand Down Expand Up @@ -77,4 +81,7 @@
'Symbology',
'BulkData',
'ScryfallError',
'KeywordAbilities',
'KeywordActions',
'AbilityWords'
]
10 changes: 8 additions & 2 deletions scrython/catalog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
from .watermarks import Watermarks
from .word_bank import WordBank
from .artist_names import ArtistNames
from .keyword_abilities import KeywordAbilities
from .keyword_actions import KeywordActions
from .ability_words import AbilityWords

__all__ = [
'ArtifactTypes',
Expand All @@ -25,5 +28,8 @@
'Toughnesses',
'Watermarks',
'WordBank',
'ArtistNames'
]
'ArtistNames',
'KeywordAbilities',
'KeywordActions',
'AbilityWords'
]
26 changes: 26 additions & 0 deletions scrython/catalog/ability_words.py
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)
26 changes: 26 additions & 0 deletions scrython/catalog/keyword_abilities.py
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)
26 changes: 26 additions & 0 deletions scrython/catalog/keyword_actions.py
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)