A python implementation for the Legends of Runeterra deck encoder/decoder, originally written in C# by Riot Games.
Project description
PyLoRDeckCodes
A python implementation for the Legends of Runeterra deck encoder/decoder, originally written in C# by Riot Games.
Installation
pip install pylordeckcodes
Usage
from pylordeckcodes import CardCodeAndCount, get_deck_from_code, get_code_from_deck
CardCodeAndCount
objects simply have 2 fields: card_code
and count
, in that order.
Decoding
get_deck_from_code(code_string, return_type="objects")
The return type defaults to a list of CardCodeAndCount
objects.
Other possible options are:
"strings"
: returns a list of strings in the form "c:00XX000"
, where "c"
is the count and "00XX000"
represents the card code.
"string"
: returns a single string of formatted counts and codes, separated by new lines. For example, "3:01DE002\n3:01PZ040\n2:01NX042"
Encoding
get_code_from_deck(deck)
Returns a regular deck code string, without Base32 padding and such.
deck
can either be:
- A list of
CardCodeAndCount
objects - A list of strings in the form
"c:00XX000"
, where"c"
is the count and"00XX000"
represents the card code. - A multi-line string of formatted counts and codes. For example,
'''3:01DE002
3:01PZ040
2:01NX042'''
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pylordeckcodes-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a0059dbb8973df2220d246ec8d69afc9254f2ed5630e06fd23ded7daa0f8d3a |
|
MD5 | 9698b12a576860b4169ab675546d7d06 |
|
BLAKE2b-256 | 44edb376698c9cf7b5b899c067b550022d9cdac00df5ae4a0d42dbcd7e7280f5 |