Asynchronous tournament and SPSA tuning platform for USI shogi engines
Project description
ShogiArena
[!NOTE] This project is still moving quickly. Public APIs are being clarified, and breaking changes are accepted during development. See CHANGELOG for release notes.
Documentation: https://nyoki-mtl.github.io/ShogiArena/index.html Japanese README: README_ja.md
ShogiArena is a platform for running shogi engine tournaments, statistical testing, dashboard monitoring, and engine automation.
Public Python API
Supported import paths:
shogiarena.engineshogiarena.tournamentshogiarena.clishogiarena.composition
Implementation modules live under shogiarena._core. They are importable but internal, and not covered by compatibility guarantees.
Installation
pip install shogiarena
Optional environment initialization:
shogiarena config init
This is useful when you need artifact-based engine resolution, placeholder variables such as {output_dir} / {engine_dir}, or shared cache settings.
Quick Examples
Use a USI engine from Python
import asyncio
from shogiarena.engine import UsiThinkRequest, create_engine
async def main() -> None:
async with await create_engine("engine.yaml") as engine:
result = await engine.think(
sfen="startpos",
request=UsiThinkRequest(movetime=5_000),
)
print(result.bestmove)
asyncio.run(main())
Run a tournament from Python
import asyncio
from shogiarena.tournament import run_tournament
async def main() -> None:
await run_tournament(
"tournament.yaml",
run_dir="runs/example",
)
asyncio.run(main())
Advanced runner construction
import asyncio
from shogiarena.tournament import (
build_tournament_runner,
create_run_storage,
load_tournament_config,
)
async def main() -> None:
config = load_tournament_config("tournament.yaml")
storage = create_run_storage("runs/example")
runner = build_tournament_runner(config, storage=storage)
await runner.run()
asyncio.run(main())
CLI Examples
shogiarena run tournament configs/run/tournament/example.yaml
shogiarena run sprt examples/configs/run/sprt/example.yaml
shogiarena run spsa examples/configs/run/spsa/example.yaml
tournament and sprt are available both from CLI and the public Python API. spsa is currently CLI-first; its Python surface is not yet formalized.
Documentation
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shogiarena-0.3.1.tar.gz.
File metadata
- Download URL: shogiarena-0.3.1.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6dbe3fc602b326b06c2c15011e93315474ccb4f3817f6d5a98087dfe44e5720
|
|
| MD5 |
af6f5438196dc7ce7406fa56b2e4ac00
|
|
| BLAKE2b-256 |
28ef6974248a4b63d93a62fcf1e167ba9c8b5fed5ad02f8a5b739ccd64f60127
|
File details
Details for the file shogiarena-0.3.1-py3-none-any.whl.
File metadata
- Download URL: shogiarena-0.3.1-py3-none-any.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3333ccb1fbb5e5fd4ee9b4d5f965c48d687d60321b74a6c1e0d5c78184f2609c
|
|
| MD5 |
1ff39c99b87b45ea30dac526c7464b9a
|
|
| BLAKE2b-256 |
b2aacd7fe037e918a70c1bb1fa14cda1b780116ce861f22a269a6709c3a2a571
|