Skip to main content

twisted_fate

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

Install

pip install twisted_fate

Usage

Create Deck from deck code

from twisted_fate import Deck

draven_deck = Deck.decode("CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ")

# results
print(deck.cards)
#[
#    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 = {
    "DeckCode":"CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ",
    "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"])
print(draven_deck.encode().deck_code)
# result: CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ

# or

print(draven_deck.to_deck_code())
# result: CEBAGAIDCQRSOCQBAQAQYDISDQTCOKBNGQAACAIBAMFQ

Metadata

Release files for twisted-fate 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for twisted-fate 0.1.5
File Size Uploaded Provenance Actions
twisted_fate-0.1.5.tar.gz 127.5 kB Without provenance Details for twisted_fate-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for twisted-fate 0.1.5
File Interpreter ABI Platform Actions
twisted_fate-0.1.5-py3-none-any.whl Python 3 none any Details for twisted_fate-0.1.5-py3-none-any.whl

Total release size: 261.4 kB

Release files / twisted_fate-0.1.5.tar.gz

Download URL twisted_fate-0.1.5.tar.gz
Size 127.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a9e9816eff88975de294b107fd7de08c42e06d5f5736011676a477b80f252497
BLAKE2b-256 checksum
How to use checksums
87bc261abcb6efffc7c872d54c2c95b2a85614fe7de0498e759028d253418fd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.0 Windows/10

Release files / twisted_fate-0.1.5-py3-none-any.whl

Download URL twisted_fate-0.1.5-py3-none-any.whl
Size 133.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1a9fbdbbd6bea9acb0655d499bd0864c070f8632eaf57cb106bab843c8b4e24
BLAKE2b-256 checksum
How to use checksums
2dc310934ee29cf287f74a97e2f944615a86a206269a6b381f837eabfc7e7e19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.0 Windows/10

Security for twisted-fate 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page