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 APIpychessview.qt: optional Qt integration module enabled through theqtextra
Requirements
- Python 3.11 or newer
- Core runtime dependencies installed automatically with
pychessview - For Qt widget support,
PySide6is 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.
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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e246a0f9da804f1b90a85995c050ad4cd11e9d8db3d5d71b56051ba01c93bfaf
|
|
| MD5 |
22e23d760e16fa65ddbe571691e46b95
|
|
| BLAKE2b-256 |
638f2354b50b80327e7a107ed42374622ea87b671a0359391120f7718e3bf655
|
Provenance
The following attestation bundles were made for pychessview-0.2.0.tar.gz:
Publisher:
publish.yml on Diblo/pychessview
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pychessview-0.2.0.tar.gz -
Subject digest:
e246a0f9da804f1b90a85995c050ad4cd11e9d8db3d5d71b56051ba01c93bfaf - Sigstore transparency entry: 1391832790
- Sigstore integration time:
-
Permalink:
Diblo/pychessview@1ebbe0e3ef017c30a3a0646a313de614e6f20b7f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Diblo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1ebbe0e3ef017c30a3a0646a313de614e6f20b7f -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0623ef5fb50e38f0349b99917b110b32604ca5cd3038711708ca80c45c62d01
|
|
| MD5 |
b652e68df910c86422250d8fbe453ee8
|
|
| BLAKE2b-256 |
8151647fa4025f012ac8a9d68d3bc5e54f9e8b4c601c705d891e2f8dc8dd3f2f
|
Provenance
The following attestation bundles were made for pychessview-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on Diblo/pychessview
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pychessview-0.2.0-py3-none-any.whl -
Subject digest:
d0623ef5fb50e38f0349b99917b110b32604ca5cd3038711708ca80c45c62d01 - Sigstore transparency entry: 1391832794
- Sigstore integration time:
-
Permalink:
Diblo/pychessview@1ebbe0e3ef017c30a3a0646a313de614e6f20b7f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Diblo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1ebbe0e3ef017c30a3a0646a313de614e6f20b7f -
Trigger Event:
workflow_dispatch
-
Statement type: