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
CardCodeAndCountobjects - 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pylordeckcodes-1.0.0.tar.gz.
File metadata
- Download URL: pylordeckcodes-1.0.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6bd43951c6828d1193adebe99eb550078c6cf56001c32beeac6e2b8c1ad22e2
|
|
| MD5 |
9edbd56e32077707e4a89227dd3218d7
|
|
| BLAKE2b-256 |
9a390b2d343c0a1822bbdb2079545292691f867f6044caad95f532fc9cbdc6d7
|
File details
Details for the file pylordeckcodes-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pylordeckcodes-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a0059dbb8973df2220d246ec8d69afc9254f2ed5630e06fd23ded7daa0f8d3a
|
|
| MD5 |
9698b12a576860b4169ab675546d7d06
|
|
| BLAKE2b-256 |
44edb376698c9cf7b5b899c067b550022d9cdac00df5ae4a0d42dbcd7e7280f5
|