How to use the scrython.cards.Search 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 / examples / spoiler_season.py View on Github external
def typeBar(typeLine, rarity):
    return "{} | {}".format(typeLine, rarity[:1].upper())

def powerAndToughness(power, toughness):
    return "{}/{}".format(power, toughness)

query = input("Enter a set: ")

currentSetSize = 0
lastList = []
currentList = []

while query is not None:

    #Grab the data
    spoilers = scrython.cards.Search(q="++e:{}".format(query), order='spoiled')

     #If the total cards has increased
    if spoilers.total_cards() > currentSetSize:

        #Dump if currentList already exists
        if currentList:
            del currentList[:]

        #If there aren't enough spoilers we iterate through the whole list.
        #Otherwise we only want the first 15
        if spoilers.total_cards() > 15:
            maxIteration = 15
        else:
            maxIteration = spoilers.total_cards()

        for i in range(maxIteration):