Coder Social home page Coder Social logo

hichesslib's Introduction

hichesslib

PyPI version fury.io Build Status Coverage Status

Description

hichesslib is a cross-platform Python GUI chess library based on python-chess and PySide2. The library comes with a board widget that supports the chess rules and provides a set of interactions with the cells of the board and with the board itself including drag and drop, cell marking, piece movement, board flipping and more.

Dependencies

Requires python version >= 3.6. For other dependencies see requirements file.

Usage

Installation

python3 -m pip install hichesslib

Initialization

To start using the library you need to create a PySide2 application. The library's widgets can be used like any Qt widget.

>>> import hichess
>>> from PySide2.QtWidgets import QApplication
>>> import sys
>>>
>>> if __name__ == "__main__":
...     app = QApplication(sys.argv)
...     boardWidget = hichess.BoardWidget()
...     boardWidget.show()
...     sys.exit(app.exec_())

Features

CellWidget

  • CellWidget can contain any chess piece.
  • Can be marked. Marked cell widgets are easily customizable.
  • Can be highlighted to display the legal moves on the board.

BoardWidget

  • BoardWidget supports all the chess rules.
  • Is easily customizable.
  • Supports rotation.
  • Supports drag and drop.
  • Games are easily traversable.
  • Interactions can be limited to only one side or for all sides (the latter is for read only boards).
  • Notifies about the game status (draw/stalemate/checkmate).

Documentation

The the documentation is located in docs.

Problems and limitations

  • In order to make CellWidget graphically customizable, after each property change, the methods unpolish and polish are called, which significantly slows down the interactions with CellWidget.

Examples

See examples folder.

Status

The library has been tested on Windows7, Windows10, Fedora 31.

Tests

Unittests are done with the unittest framework. Tests are located in hichesslib/test/.

License

hichesslib is licensed under GPLv3.0+ license. See license file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.