semvec/pypi-packages huggingface dataset:
chess-board-edu 0.0.3
A simple tool to update a chess board
Requires Python: >=3.6

# Chess Board EDU

Update a chess board based on moves from a PNG file using algebraic notation. 
This project is for educational purposes.

## How to use

First, instantiate the Board object:

```
from chess_board_edu import Board


board = Board()
r = board.move('e4')  # moves white pawn two places
```

The function `move` returns a list of dictionaries with a couple of fields:

```
[{
    'piece': 'K',
    'from': 'g5',
    'to': 'g4' 
    'original_move': 'Kg4'
}]
```

In case of a castling move, two dictionaries are provided.

The player is not given, but this can be tracked using the moves that are passed
*to* this library (odd for white, even for black), or be inferred from the 'piece' 
field: uppercase characters are played by white, while lowercase characters are 
played by black.

Because the original location is provided, as well as the target location and the 
piece that is played, it becomes straightforward to update a "visual" board. Some
validation can then also be performed: if the piece is not at the original location,
something went wrong. 

HOWEVER. This package does not validate the moves, nor is it complete in the sense 
that it will handle *any* possible move that can potentially be played. For instance, 
this version does not take into account a move that is played from a specific *rank* 
or a fully specified square. 

The assumption is made that the moves provided are validated externally beforehand.