Skip to Content
PythonShenanigans
Getting started

Installation

Install PythonShenanigans and pick a zstd backend.

Requirements

  • Python 3.13 or newer.
  • A zstd implementation (see below).

Install

pip install pythonshenanigans

zstd backends

Character codes are zstd-compressed, so the library needs an implementation. It uses the first one that imports successfully:

BackendComes fromNotes
compression.zstdPython 3.14+ standard librarynothing to install
zstdthe zstd packagenewest release is yanked on PyPI; kept only as a fallback
pyzstdthe pyzstd packageinstalled automatically on Python 3.13
zstandardthe zstandard packageavailable as the zstandard extra

To see which one is active:

import pythonshenanigans as pts

print(pts.backend_name())

Forcing a backend

Set PYTHONSHENANIGANS_ZSTD_BACKEND before the first call. The named backend is tried first, and the others stay as fallbacks if it is unavailable.

PYTHONSHENANIGANS_ZSTD_BACKEND=pyzstd python build_moveset.py
from pythonshenanigans import codec

codec.ENV_BACKEND  # 'PYTHONSHENANIGANS_ZSTD_BACKEND'

Every backend writes the same frame shape the game itself emits, so a code does not depend on which one you used.

Optional extras

pip install "pythonshenanigans[zstandard]"

From source

git clone https://github.com/dnd-ed/pythonshenanigans
cd pythonshenanigans
pip install -e ".[dev]"
python -m pytest

On this page