- This microservice, but especially the install.sh script has only been tested in a Linux environment. Compatibility with other operating systems is not guaranteed.
- Only PGN is supported as an input notation at the moment
- The microservice is not yet able to detect incorrectly formatted inputs
- Git
- Python3
- Pip
- Recommended: python3-venv
Bash:
./install.shBash:
# Create a new terminal and navigate to it
python3 src/formatServer.py
# Go back to the original terminal for example
python3 src/formatClient.py # example_client.py
# Connect to the gRPC server
channel = grpc.insecure_channel("localhost:50051")
# Create stub
stub = jsonFormat_pb2_grpc.jsonFormatServiceStub(channel)
pgn_data = """
[Event "Test Game"]
[Site "Local"]
[Date "2026.05.18"]
[Round "1"]
[White "WhitePlayer"]
[Black "BlackPlayer"]
[Result "*"]
1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 *
"""
request = jsonFormat_pb2.request(
notationType="PGN",
boardData=pgn_data,
isCLI="NoCLI"
)
response = stub.PGNtoBoard(request)| Field | Type | Description |
|---|---|---|
notationType |
string | Represents the form of notation. Currently only PGN is supported |
boardData |
string | String representing the board in the specified notation |
isCLI |
string | CLI if the caller wants an array of strings. NoCLI for JSON return |
# Continuing from the request
response = stub.PGNtoBoard(request)
print("===== Server Response =====")
print(f"Error Message : {response.errorMsg}")
print(f"Chessboard Response: \n{response.chessboard}")| Field | Type | Description |
|---|---|---|
errorMsg |
string | Empty if no error is encountered, otherwise provides a descriptive error message |
chessboard |
json or string[] | If the value for isCLI is "CLI", returns a string[], otherwise JSON representing the board state |