betza-visualizer
Visualizes fairy chess piece movements from their Betza notation.
The project contains:
- a reusable dependency-free Python package, importable as
betza_visualizer - a Python Textual TUI frontend
- a browser frontend using TypeScript, HTML, CSS, and SVG
Python library usage
The core parser and SVG renderer have no runtime dependencies:
from betza_visualizer import BetzaParser, BetzaSvgOptions, render_betza_svg
moves = BetzaParser().parse("BN", board_size=11)
svg = render_betza_svg("BN", BetzaSvgOptions(piece_label="A", title="Archbishop movement"))
The generated SVG string is intended to be embedded directly into documentation pages.
TypeScript library usage
The browser parser is also published as @pychess/betza. The visualizer and
consumers such as premove generators use the same parsed movement model:
import { BetzaParser, createBetzaPremove, parseBetza } from "@pychess/betza";
const movement = parseBetza("fRffN");
const visualizerMoves = new BetzaParser().parse("fRffN", 8);
const premove = createBetzaPremove("fRffN");
const targets = premove({
origin: [3, 3],
color: "white",
board: { width: 8, height: 8 },
});
Premove targets are intentionally conservative: current blockers, occupancy, capture modality, hopper screens, and check legality are ignored because the opponent may change the position first. The game server must validate the move when it is eventually submitted.
The parser remains permissive and reports unsupported fragments through the
warnings property. This preserves the visualizer's best-effort behavior and
allows broader original Betza and future XBetza support without adding separate
consumer-specific parsers.
Try the web app
The browser frontend is available online:
https://betza-visualizer.vercel.app/
Run the TUI locally
The Textual TUI frontend currently lives in the repository-level main.py, so clone the
repository frst:
git clone https://github.com/gbtami/betza-visualizer.git
cd betza-visualizer
Then install the optional TUI dependencies and start the app:
python -m venv .venv
source .venv/bin/activate
pip install -e '.[tui]'
python main.py
On Windows, activate the virtual environment with:
.venv\Scripts\Activate.ps1
If you use uv, the shorter equivalent is:
uv run --extra tui python main.py
Inside the TUI, type a Betza expression, pick a built-in piece from the list, change the
board size from the selector, or click board squares to toggle blockers. Press F1 for
the in-app help and Ctrl+L to load pieces from a local variants.ini file.
Development
pip install -e '.[dev]'
python -m pytest tests/python_unittests
Publishing
The package metadata is defined in pyproject.toml. A local wheel can be built with:
python -m build
Almost everything in this repository made by using Google and OpanAI tools.
Google AI Studio, gemini-cli, Google Labs Jules using gemini-2.5-pro, gemini2.5-flash
codex-cli using gpt-5.4-codex, gpt-5.5-codex
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 betza_visualizer-0.1.1.tar.gz.
File metadata
- Download URL: betza_visualizer-0.1.1.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e638b65fd0ce340f014071435740ed6087dd770ff72aabd7fe99e0428eb7da4
|
|
| MD5 |
42fa39ff4debd52b444a28ca8eecc87e
|
|
| BLAKE2b-256 |
24e23a47dce6dcd76a8e63dcba900a686a501befc80f6e65524b00cb56189c73
|
Provenance
The following attestation bundles were made for betza_visualizer-0.1.1.tar.gz:
Publisher:
publish.yml on gbtami/betza-visualizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
betza_visualizer-0.1.1.tar.gz -
Subject digest:
5e638b65fd0ce340f014071435740ed6087dd770ff72aabd7fe99e0428eb7da4 - Sigstore transparency entry: 2410102174
- Sigstore integration time:
-
Permalink:
gbtami/betza-visualizer@aea79e33eb30efd1de83ab09985ec653a7608983 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/gbtami
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aea79e33eb30efd1de83ab09985ec653a7608983 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file betza_visualizer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: betza_visualizer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d912f22d342c6154a8c639ce222a10c56a36bc6dad8c53916ec108b0d62d4e7
|
|
| MD5 |
1e512e7dd12865ccf32ef7f58cdcbccd
|
|
| BLAKE2b-256 |
a2ed261009104ebeccb8c00992f20fb35d80895eb3741e2a6c1d00cc8535dc4e
|
Provenance
The following attestation bundles were made for betza_visualizer-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on gbtami/betza-visualizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
betza_visualizer-0.1.1-py3-none-any.whl -
Subject digest:
7d912f22d342c6154a8c639ce222a10c56a36bc6dad8c53916ec108b0d62d4e7 - Sigstore transparency entry: 2410102232
- Sigstore integration time:
-
Permalink:
gbtami/betza-visualizer@aea79e33eb30efd1de83ab09985ec653a7608983 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/gbtami
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aea79e33eb30efd1de83ab09985ec653a7608983 -
Trigger Event:
workflow_dispatch
-
Statement type: