module documentation

Token stream decoder

Function decode Decodes a byte stream into a list of TIToken objects and its minimum supported OS version
def decode(bytestream: bytes, *, tokens: TITokens = None) -> tuple[list[TIToken], OsVersion]: (source) ΒΆ

Decodes a byte stream into a list of TIToken objects and its minimum supported OS version

Each token is represented using one of three different representations formats, dictated by mode:
  • display: Represents the tokens with Unicode characters matching the calculator's display
  • accessible: Represents the tokens with ASCII-only equivalents, often requiring multi-character glyphs
  • ti_ascii: Represents the tokens with their internal font indices (returns a bytes object)
Parameters
bytestream:bytesThe token bytes to decode
tokens:TITokensThe TITokens object to use for decoding (defaults to the TI-84+CE tokens)
Returns
tuple[list[TIToken], OsVersion]A tuple of a list of TIToken objects and a minimum OsVersion