A lightweight, dependency-free Python wrapper for the Reckless UCI chess engine.
python-reckless does not bundle the engine. Reckless is a standalone
compiled executable; this package launches it as a subprocess and speaks the
UCI protocol to it. You supply the binary.
Download a prebuilt binary for your platform from the Reckless releases page, then make it discoverable in one of these ways:
- Put it on your
PATHasreckless, or - set the
RECKLESS_PATHenvironment variable to its full path, or - pass the path directly:
Reckless(path="/path/to/reckless").
pip install python-recklessThe import name is reckless (the distribution name is python-reckless).
from reckless import Reckless
with Reckless() as engine:
engine.new_game()
engine.set_position(moves=["e2e4", "e7e5"])
best = engine.best_move(depth=12)
print("Reckless suggests:", best)You can also search by time instead of depth:
move = engine.best_move(movetime=1000) # think for 1 secondMake changes on a feature branch and put up to date engine.py files and other helper files in the src directory.
For a fully featured UCI client (analysis info, evaluations, multipv, async),
consider the mature python-chess library,
whose chess.engine.SimpleEngine.popen_uci() works with Reckless out of the
box. This package is intentionally tiny and focused.
MIT