Skip to main content

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


Download files

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

Source Distribution

pylordeckcodes-1.0.0.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

pylordeckcodes-1.0.0-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page