Skip to main content

PyPi Release Docker CI

ChessLib Python Extension

About

This project provides an efficient chess draw generation extension for Python3. The main purpose of this project is enabling further TensorFlow AI projects and learning how to write an efficient Python3 extension (using good old C).

Usage

Install the official Python package using pip:

pip install chesslib

Use the chesslib package like in the following example:

import chesslib
import numpy as np
import random


def test():

    # create a new chess board in start formation
    board = chesslib.ChessBoard_StartFormation()

    # generate all possible draws
    draws = chesslib.GenerateDraws(board, chesslib.ChessColor_White, chesslib.ChessDraw_Null, True)

    # apply one of the possible draws
    draw_to_apply = draws[random.randint(0, len(draws) - 1)]
    new_board = chesslib.ApplyDraw(board, draw_to_apply)

    # write the draw's name
    print(chesslib.VisualizeDraw(draw_to_apply))

    # visualize the board before / after applying the draw
    print(chesslib.VisualizeBoard(board))
    print(chesslib.VisualizeBoard(new_board))

    # revert the draw (just call ApplyDraw again with the new board)
    rev_board = chesslib.ApplyDraw(new_board, draw_to_apply)

    # get the board's 40-byte-hash and create a new board instance from the hash
    board_hash = chesslib.Board_ToHash(board)
    board_reloaded = chesslib.Board_FromHash(board_hash)

    # see tests/ folder for more examples

How to Develop

The commands for dev-testing the chesslib are wrapped within a Docker environment. Therefore build the 'Dockerfile-dev' file which takes your source code and performs all required CI steps (build + install + unit tests). Afterwards you may attach to the Docker image with the bash console interactively and run commands, etc.

# make a dev build using the 'Dockerfile-dev' build environment
# this runs all CI steps (build + install + unit tests)
docker build . --file Dockerfile-dev -t "chesslib-dev"

# attach to the build environment's interactive bash console (leave the session with 'exit')
docker run "chesslib-dev" -it bash

# mount a Python test script into the build environment and run it
docker run -v $PWD:/scripts "chesslib-dev" python3 /scripts/test.py

Advantages of this approach are that it simplifies the dev machine setup a lot as you only need Docker, git and a good text editor on your local machine. Moreover you don't mess up your dev machine when trying to build and install the chesslib package for debugging again and again. And most importantly you keep your local copy of the git repo clean as all temporary files are created within the Docker container, so you basically don't need to worry about accidentially including build files into git commits, etc.

For a quickstart, set up your dev machine as a VM (e.g. Ubuntu 20.04 hosted by VirtualBox). After successfully creating the VM, use following commands to install all essential dev tools (git, docker, good text editor).

# install docker (e.g. Ubuntu 20.04)
sudo apt-get update && sudo apt-get install -y git docker.io
sudo usermod -aG docker $USER && reboot

# download the project's source code (if you haven't done before)
git clone https://github.com/Bonifatius94/ChessLib.Py
cd ChessLib.Py

# install the 'Visual Studio Code' text editor (optional)
sudo snap install code --classic

You may use this project under the MIT licence's conditions.

Metadata

Release files for chesslib 1.0.333892741

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for chesslib 1.0.333892741
File
chesslib-1.0.333892741-cp39-cp39-manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
chesslib-1.0.333892741-cp39-cp39-manylinux2010_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.12+ x86-64 Details
chesslib-1.0.333892741-cp39-cp39-manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details
chesslib-1.0.333892741-cp38-cp38-manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
chesslib-1.0.333892741-cp38-cp38-manylinux2010_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.12+ x86-64 Details
chesslib-1.0.333892741-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
chesslib-1.0.333892741-cp37-cp37m-manylinux2014_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 Details
chesslib-1.0.333892741-cp37-cp37m-manylinux2010_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Details
chesslib-1.0.333892741-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
chesslib-1.0.333892741-cp36-cp36m-manylinux2014_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ x86-64 Details
chesslib-1.0.333892741-cp36-cp36m-manylinux2010_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 Details
chesslib-1.0.333892741-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details

Total release size: 730.5 kB

Release files / chesslib-1.0.333892741-cp39-cp39-manylinux2014_x86_64.whl

Download URL chesslib-1.0.333892741-cp39-cp39-manylinux2014_x86_64.whl
Size 63.9 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
01e7c9c1227cb90bc252919e09980fb5f2fbd1c7bfcb9b3e416431eda5b54d14
BLAKE2b-256 checksum
How to use checksums
2ad4eea98d72482e02411cce1d8ab7035a8b30d246d17f3e8c16b341f38e86cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

Release files / chesslib-1.0.333892741-cp39-cp39-manylinux2010_x86_64.whl

Download URL chesslib-1.0.333892741-cp39-cp39-manylinux2010_x86_64.whl
Size 63.5 kB
Tags CPython 3.9 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
2f41d43306bf4826eed1f6ac22ff2056c970d2914e73276404480e3e016f2c55
BLAKE2b-256 checksum
How to use checksums
d7f24c3583fff5b75c35e13dc989d2a7d809991f5f53758ba1e92e6329259d21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

Release files / chesslib-1.0.333892741-cp39-cp39-manylinux1_x86_64.whl

Download URL chesslib-1.0.333892741-cp39-cp39-manylinux1_x86_64.whl
Size 54.2 kB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
37213d224f04c4de4b9bfddae862ec8e8dd5728c3f474a3722abb9d435548324
BLAKE2b-256 checksum
How to use checksums
67500f03c422c0b919f86e99ee26eaa44f889d86de18cf9cde00938ce5e349b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

Release files / chesslib-1.0.333892741-cp38-cp38-manylinux2014_x86_64.whl

Download URL chesslib-1.0.333892741-cp38-cp38-manylinux2014_x86_64.whl
Size 64.3 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
6c706d27d185894fb74261cae0a31c700dcadfeaf375e81bb409b1438efd10a0
BLAKE2b-256 checksum
How to use checksums
6fd562ace8832484119e9ca0f6d7e6192d030303ac00d9e795908bb4056a5f06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

Release files / chesslib-1.0.333892741-cp38-cp38-manylinux2010_x86_64.whl

Download URL chesslib-1.0.333892741-cp38-cp38-manylinux2010_x86_64.whl
Size 63.9 kB
Tags CPython 3.8 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
8f694a314650ddbb8f4c949c2a12c1018f9341c74ecc65a68151eba8cb0655a0
BLAKE2b-256 checksum
How to use checksums
6ea8b610dd1f1977c4c73bbca992d7aaba6ef21b0cdfb87de6d0e559ac95ca91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

Release files / chesslib-1.0.333892741-cp38-cp38-manylinux1_x86_64.whl

Download URL chesslib-1.0.333892741-cp38-cp38-manylinux1_x86_64.whl
Size 54.7 kB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
be19fbd7c08493ecac7469ead771e8f62a8cba22f5612e6d989cdc474a6d5cfb
BLAKE2b-256 checksum
How to use checksums
3f316aa0110cc6808e5f6bafde9f32b3a821a5b3c3539efd2aff2c7c37dd85eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

Release files / chesslib-1.0.333892741-cp37-cp37m-manylinux2014_x86_64.whl

Download URL chesslib-1.0.333892741-cp37-cp37m-manylinux2014_x86_64.whl
Size 65.0 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
0449c8e485e081a8ba9ec317ba56fe16d3cd6f5e2659691e772cf14a44b071e6
BLAKE2b-256 checksum
How to use checksums
d187c29d653520838fe0ad7cd123de22c87c92dc8cc003c7d103fe89cede3da5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

Release files / chesslib-1.0.333892741-cp37-cp37m-manylinux2010_x86_64.whl

Download URL chesslib-1.0.333892741-cp37-cp37m-manylinux2010_x86_64.whl
Size 64.7 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
cd07b2de0ede6398891cefc032461cf6481f0ec0d7220b929108c46fe015223c
BLAKE2b-256 checksum
How to use checksums
27af4997844c7e08aca8e7e565da2166c1d48a5b7a713624ae02dbaac794f082
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

Release files / chesslib-1.0.333892741-cp37-cp37m-manylinux1_x86_64.whl

Download URL chesslib-1.0.333892741-cp37-cp37m-manylinux1_x86_64.whl
Size 54.3 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
3b7b9b1f7c1a547640db96bf5d6b01876b5f7a6cf60cafe6d8ca410ebbe67cf8
BLAKE2b-256 checksum
How to use checksums
139378f92c1ebf788ab1e254e3be803814a9d0681974f40b28e203de5269201f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

Release files / chesslib-1.0.333892741-cp36-cp36m-manylinux2014_x86_64.whl

Download URL chesslib-1.0.333892741-cp36-cp36m-manylinux2014_x86_64.whl
Size 64.1 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a1795deb2dd04b7d711c53c484559ea69b9dbf1a5d7b69e1b52119e813beffff
BLAKE2b-256 checksum
How to use checksums
6749645f936cca10a7b8e52f26790a4bfae533b457339d2504beae9de0705c12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

Release files / chesslib-1.0.333892741-cp36-cp36m-manylinux2010_x86_64.whl

Download URL chesslib-1.0.333892741-cp36-cp36m-manylinux2010_x86_64.whl
Size 63.7 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
6188b81cfa5e3ae0b25d66d483ab7d7386927eaff975caea8a506be4b7712c1b
BLAKE2b-256 checksum
How to use checksums
d51ab3344f0a4816d97364ab81e70997a5574b59a8fee43bd3a64685d9018fcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

Release files / chesslib-1.0.333892741-cp36-cp36m-manylinux1_x86_64.whl

Download URL chesslib-1.0.333892741-cp36-cp36m-manylinux1_x86_64.whl
Size 54.3 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
4f28b5418979496587302c2a19fd0b284862bc8b2e70ccc50aa5f32a8da7d8ed
BLAKE2b-256 checksum
How to use checksums
d5c4eb6d3b636b8273747a4330a7093cb268747033700774c21f143b9271f812
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

Release history Release notifications | RSS feed

This release

1.0.333892741 This release

12 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page