Skip to main content

Interactive chessboard view library with optional Qt widget.

Project description

Pychessview

Pychessview is a Python library for building interactive chessboard UIs without coupling presentation logic to a specific GUI framework or chess engine.

The project is published as a single PyPI distribution:

  • pychessview: core package providing board state, layout, rendering, interaction handling, themes, and the public view API
  • pychessview.qt: optional Qt integration module enabled through the qt extra

Requirements

  • Python 3.11 or newer
  • Core runtime dependencies installed automatically with pychessview
  • For Qt widget support, PySide6 is required

Install only the core package when no GUI backend is needed:

pip install pychessview

Install the optional Qt widget support when using PySide:

pip install "pychessview[qt]"

The core package defines rendering contracts, game/session orchestration, and interaction behavior while remaining backend-agnostic. The optional Qt module builds on this foundation with QtRenderer, QtControllerAdapter, and ChessboardWidget.

This design enables reusable and extensible chessboard UIs for applications such as chess GUIs, analysis tools, and training software, where the UI layer remains independent from the underlying game implementation.

Quick Start

Qt provides the simplest way to render a chessboard:

from PySide6.QtWidgets import QApplication

from pychessview import StandardChessFactory
from pychessview.qt import ChessboardWidget


def main() -> int:
    app = QApplication.instance() or QApplication([])

    widget = ChessboardWidget(game_spec=StandardChessFactory.create_game_spec())
    widget.resize(640, 640)
    widget.show()

    return app.exec()

The core package can also be used without Qt by providing a pychessview.RendererProtocol implementation and initializing pychessview.View directly.

Documentation

  • Engine Guide: backend-agnostic engine usage with View, GameSpec, themes, and renderers
  • Qt Widget Guide: widget construction, state access, and Qt-specific behavior
  • Development Guide: workspace layout, architecture, tooling, and test conventions

Example

A runnable Qt example is available at examples/qt_demo.py.

Chessboard preview

The Qt example supports these interactions:

  • Use the left mouse button to select, move, and drag pieces.
  • Use Shift, Ctrl, or Alt with the left mouse button to add a circle or arrow.
  • Use the right mouse button to delete a circle or arrow.

License

This project is licensed under the Apache License 2.0.

GitHub profile: Diblo/pychessview

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pychessview-0.2.0.tar.gz (501.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pychessview-0.2.0-py3-none-any.whl (557.9 kB view details)

Uploaded Python 3

File details

Details for the file pychessview-0.2.0.tar.gz.

File metadata

  • Download URL: pychessview-0.2.0.tar.gz
  • Upload date:
  • Size: 501.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pychessview-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e246a0f9da804f1b90a85995c050ad4cd11e9d8db3d5d71b56051ba01c93bfaf
MD5 22e23d760e16fa65ddbe571691e46b95
BLAKE2b-256 638f2354b50b80327e7a107ed42374622ea87b671a0359391120f7718e3bf655

See more details on using hashes here.

Provenance

The following attestation bundles were made for pychessview-0.2.0.tar.gz:

Publisher: publish.yml on Diblo/pychessview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pychessview-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pychessview-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 557.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pychessview-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0623ef5fb50e38f0349b99917b110b32604ca5cd3038711708ca80c45c62d01
MD5 b652e68df910c86422250d8fbe453ee8
BLAKE2b-256 8151647fa4025f012ac8a9d68d3bc5e54f9e8b4c601c705d891e2f8dc8dd3f2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pychessview-0.2.0-py3-none-any.whl:

Publisher: publish.yml on Diblo/pychessview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page