module documentation

Token stream decoder

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

Decodes a byte stream into a list of Token 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:TokensThe Tokens object to use for decoding (defaults to the TI-84+CE tokens)
Returns
tuple[list[Token], OsVersion]A tuple of a list of Token objects and a minimum OsVersion
def invalid_token(bits: bytes) -> Token: (source)

Undocumented