How to use the scrython.foundation.FoundationObject function in scrython

To help you get started, we’ve selected a few scrython examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NandaScott / Scrython / scrython / cards / cards_object.py View on Github external
import sys
sys.path.append('..')
from scrython.foundation import FoundationObject
import aiohttp
import asyncio
import urllib.parse
from threading import Thread

class CardsObject(FoundationObject):
    """
    Master class that all card objects inherit from.

    Args:
        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.
github NandaScott / Scrython / scrython / sets / code.py View on Github external
import sys
sys.path.append('..')
from scrython.foundation import FoundationObject

class Code(FoundationObject):
    """
    sets/:code
    Get a set with a 3 letter code.

    Args:
        code (string): 
            The 3 letter code of the set.
        format (string, optional):
            Returns data in the specified method. Defaults to JSON.
        pretty (string, optional):
            Returns a prettier version of the json object. Note that this may break functionality with Scrython.

    Returns:
        N/A

    Raises:
github NandaScott / Scrython / scrython / cards / search.py View on Github external
import sys
sys.path.append('..')
from scrython.foundation import FoundationObject
from .cards_object import CardsObject
import urllib.parse

class Search(FoundationObject):
    """
    cards/search
    Uses a search query to gather relevant data.

    Args:
        q (string):
            The query to search. This will be updated in the future.
        order (string, optional):
            Defaults to 'none'
            The order you'd like the data returned.
        unique (string, optional):
            Defaults to 'none'
            A way to filter similar cards.
        dir (string, optional)
            Defaults to 'none'
            The direction you'd like to sort. (asc, desc, auto)
github NandaScott / Scrython / scrython / bulk_data / bulk_data.py View on Github external
import sys
sys.path.append('..')
from scrython.foundation import FoundationObject
import asyncio
import aiohttp
import urllib.parse
from threading import Thread
import warnings

class BulkData(FoundationObject):
    """
    /bulk-data
    Queries and creates an object relating to the /bulk-data endpoint.

    Args:
        N/A

    Returns:
        object: The Scryfall endpoint object.

    Raises:
        Exception: Raised if Scryfall sends an error object.

    Examples:
        >>> data = scrython.bulk_data.BulkData()
        >>> data.bulk_compressed_size()
github NandaScott / Scrython / scrython / sets / sets_object.py View on Github external
import sys
sys.path.append('..')
from scrython.foundation import FoundationObject
import asyncio
import aiohttp
import urllib.parse
from threading import Thread

class SetsObject(FoundationObject):
    """
    The master class for all sets objects.

    Positional arguments:
        No arguments required.

    Optional arguments:
        format : str ................... The format to return. Defaults to JSON.
        pretty : bool ... Makes the returned JSON prettier. The library may not work properly with this setting.

    Attributes:
        object : str ...... Returns the type of object it is. (card, error, etc)
        code : str ........................ The three letter set code of the set
        mtgo_code : str ........................ The mtgo equivalent of `code()`
        name : str ................................... The full name of the set.
        set_type : str ......... The type of the set (expansion, commander, etc)