Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

An api wrapper around the Legends of Runeterra Client API with deck encoder implementation

Project description


A python api wrapper to for riot's Legends of Runterra client-api including a port of Riot Games C# implementation of the deck encoder/decoder


pip install twisted_fate


Create Deck from deck code

from twisted_fate import Deck


# results
#    Card(01NX020, Name: Draven, Cost: 3), 
#    Card(01NX035, Name: Draven's Biggest Fan, Cost: 1), 
#    Card(01NX039, Name: Vision, Cost: 3), 
#    Card(01PZ001, Name: Rummage, Cost: 1), 
#    Card(01PZ012, Name: Flame Chompers!, Cost: 2), 
#    Card(01PZ013, Name: Augmented Experimenter, Cost: 6), #    Card(01PZ018, Name: Academy Prodigy, Cost: 2), 
#    Card(01PZ028, Name: Jury-Rig, Cost: 1), 
#    Card(01PZ038, Name: Sump Dredger, Cost: 2), 
#    Card(01PZ039, Name: Get Excited!, Cost: 3), 
#    Card(01PZ040, Name: Jinx, Cost: 4), 
#    Card(01PZ045, Name: Zaunite Urchin, Cost: 1), 
#    Card(01PZ052, Name: Mystic Shot, Cost: 2), 
#    Card(01NX011, Name: Whirling Death, Cost: 3)
# ]

Create Deck from cards list, (in the format of a response from the client api)

from twisted_fate import Deck
# client api response
deck = {
    "CardsInDeck": {
        "01NX020": 3,
        "01NX035": 3,
        "01NX039": 3,
        "01PZ001": 3,
        "01PZ012": 3,
        "01PZ013": 3,
        "01PZ018": 3,
        "01PZ028": 3,
        "01PZ038": 3,
        "01PZ039": 3,
        "01PZ040": 3,
        "01PZ045": 3,
        "01PZ052": 3,
        "01NX011": 1,

draven_deck = Deck(cards=deck["CardsInDeck"])

# or


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for twisted-fate, version 0.1.5
Filename, size File type Python version Upload date Hashes
Filename, size twisted_fate-0.1.5-py3-none-any.whl (133.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size twisted_fate-0.1.5.tar.gz (127.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page