How to use the fpl.utils.chip_converter function in fpl

To help you get started, we’ve selected a few fpl 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 amosbastian / fpl / tests / test_utils.py View on Github external
def test_chip_converter():
        chips = ["TC", "WC", "BB", "FH"]
        converted = [chip_converter(chip) for chip in [
            "3xc", "wildcard", "bboost", "freehit"]]

        assert chips == converted
github amosbastian / fpl / fpl / cli.py View on Github external
def available_chips(chips):
    """Returns formatted string of available chips."""
    available = ["WC", "TC", "BB", "FH"]
    used = [chip_converter(chip["name"]) for chip in chips]
    return ", ".join(list(set(available) - set(used)))
github amosbastian / fpl / fpl / cli.py View on Github external
def used_chips(chips):
    """Returns formatted string of used chips."""
    if not chips:
        return "NONE."
    used = ["{} (GW {})".format(chip_converter(chip["name"]), chip["event"])
            for chip in chips]
    return ", ".join(used)