npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pychess/betza

v0.1.3

Published

Betza notation visualizer with a reusable TypeScript parser and conservative premove generator.

Readme

PyPI version PyPI - Python Version License: MIT TUI Tests Web App Tests

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