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


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

Roadmap

Following features are planned for the near future:

  • change Board_ToHash() / Board_FromHash() exchange format to Python type 'bytes' or 'bytearray' for better compatibility
  • improve code coverage of unit tests
  • implement CI/CD GitHub pipelines for DockerHub and PyPi releases
  • fix all memory leaks of the lib (if there even are leaks)
  • think of performence testing / performance improvements (especially draw-gen)

Following optional / fancy improvements are to be considered:

  • add fancy status badges, beautify README
  • add API documentation compatible with common Python linters

Copyright

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

Metadata

Release files for chesslib 1.0.329518997

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.329518997
File
chesslib-1.0.329518997-cp39-cp39-manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
chesslib-1.0.329518997-cp39-cp39-manylinux2010_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.12+ x86-64 Details
chesslib-1.0.329518997-cp39-cp39-manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details
chesslib-1.0.329518997-cp38-cp38-manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
chesslib-1.0.329518997-cp38-cp38-manylinux2010_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.12+ x86-64 Details
chesslib-1.0.329518997-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
chesslib-1.0.329518997-cp37-cp37m-manylinux2014_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 Details
chesslib-1.0.329518997-cp37-cp37m-manylinux2010_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Details
chesslib-1.0.329518997-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
chesslib-1.0.329518997-cp36-cp36m-manylinux2014_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ x86-64 Details
chesslib-1.0.329518997-cp36-cp36m-manylinux2010_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 Details
chesslib-1.0.329518997-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
chesslib-1.0.329518997-cp35-cp35m-manylinux2014_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.17+ x86-64 Details
chesslib-1.0.329518997-cp35-cp35m-manylinux2010_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.12+ x86-64 Details
chesslib-1.0.329518997-cp35-cp35m-manylinux1_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64 Details

Total release size: 866.8 kB

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

Download URL chesslib-1.0.329518997-cp39-cp39-manylinux2014_x86_64.whl
Size 61.2 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7e518e8ea774c55a612b99180e5d85be822b62d5927aa1fc9ceb2f20bbb1a08d
BLAKE2b-256 checksum
How to use checksums
3b8dac0cc29a6255d52063ac59cf2c588e9b0b38c6f946880e3d362c090d5079
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

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

Download URL chesslib-1.0.329518997-cp39-cp39-manylinux2010_x86_64.whl
Size 60.8 kB
Tags CPython 3.9 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
3dcf352f34dea618bdad278fb45e8bb3a865ac46627103bc98518e4c26b49c11
BLAKE2b-256 checksum
How to use checksums
762b09b97e6aa03cb5f0fcec4621006aa463096b43a6715a726100a321099f9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

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

Download URL chesslib-1.0.329518997-cp39-cp39-manylinux1_x86_64.whl
Size 50.7 kB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
f10df4ee7c210fb0778dd71f2d107e59d5bf043387b83a4a7933b35c7995cd21
BLAKE2b-256 checksum
How to use checksums
5177c9932881e8c77472e10864075dd54a453fc6bb9da7a35ec29bd1bc28abd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

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

Download URL chesslib-1.0.329518997-cp38-cp38-manylinux2014_x86_64.whl
Size 61.4 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b116b6c6896696d4ddd770faabdb5085e39e8de4fd4a505b7fc8982377b5e002
BLAKE2b-256 checksum
How to use checksums
0086482dabd5e4d07419e1163705ed4b4eb1a517c1b62dabd92f8afae3e048a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

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

Download URL chesslib-1.0.329518997-cp38-cp38-manylinux2010_x86_64.whl
Size 61.2 kB
Tags CPython 3.8 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
b92ad48fe744daf672ffb60c9d81f7b1c08478cf538fec9c447beece85fd13db
BLAKE2b-256 checksum
How to use checksums
84c2a09c7a1631bfad919aad26da697dab583c40b3e68a034faa17ea68436580
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

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

Download URL chesslib-1.0.329518997-cp38-cp38-manylinux1_x86_64.whl
Size 51.1 kB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
67ec86c82e3c419744ae50ebc57fe02c30b3adf2c5f2a4d3202bbc14991354e5
BLAKE2b-256 checksum
How to use checksums
49d335bd6d275dbf8194a06b592399ec2c149d5a539dbf6c24610d0551f39f8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

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

Download URL chesslib-1.0.329518997-cp37-cp37m-manylinux2014_x86_64.whl
Size 62.2 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
802fa82a25180e2e259524bbb48123e68398a90c761fd583d532145d6e3a337c
BLAKE2b-256 checksum
How to use checksums
40c654f9f311a836489838fe1a0a511470903fc8dfdf665cbbac02c8ef240242
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

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

Download URL chesslib-1.0.329518997-cp37-cp37m-manylinux2010_x86_64.whl
Size 62.0 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
7fac5784ad0d6ba9f322658833ba6fec925e201929af42fa7153e99afd98dae3
BLAKE2b-256 checksum
How to use checksums
a11955dfbcb31afef7f4c7f19f5143cc58f91eb9be0acc56f9a02984937f30b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

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

Download URL chesslib-1.0.329518997-cp37-cp37m-manylinux1_x86_64.whl
Size 50.7 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
d2c31f7c1fca2bb62872281cc26bc9c2cc7eabfc4e23ad310a5395fd2d1705dc
BLAKE2b-256 checksum
How to use checksums
24192846944cdaf3329fea73de26d202e178aeff0fdcd8bf044487c10e15c85e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

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

Download URL chesslib-1.0.329518997-cp36-cp36m-manylinux2014_x86_64.whl
Size 61.3 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b0fab6f5306829f9ca6925b52ba1310c00e2e027b343839b5ee5acaa684153cc
BLAKE2b-256 checksum
How to use checksums
232c1075c5bfd334ef12ce3e24e48c87f432f679ac6fcf47ca093d1ec024edd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

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

Download URL chesslib-1.0.329518997-cp36-cp36m-manylinux2010_x86_64.whl
Size 61.0 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
0a6f629d5de6a4383c0925d25783f4dd22f9024f5374887e4e1ea0fd147cf814
BLAKE2b-256 checksum
How to use checksums
4c2ada85ac3aa99ed8086db85566e5f185b867ebed411f98a9c5555bdb44bc2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

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

Download URL chesslib-1.0.329518997-cp36-cp36m-manylinux1_x86_64.whl
Size 50.7 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
fb0dab7b7fcbefdb28c770842d1a360553738f7cac5dec32d6e861a2a1723407
BLAKE2b-256 checksum
How to use checksums
e89ee2be1b01f3f7de30826cc5a2fb8cfaac86ad1ef325ed1823dbe498533e5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

Release files / chesslib-1.0.329518997-cp35-cp35m-manylinux2014_x86_64.whl

Download URL chesslib-1.0.329518997-cp35-cp35m-manylinux2014_x86_64.whl
Size 61.0 kB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1d1eb482679712dd54b9c619064417ea753cdc29af7ceddc0a0ec9a391f06383
BLAKE2b-256 checksum
How to use checksums
22b56b0c7a1af4df62fd0aa70a0af73c37cb78c284c3255b1a941af4f895f02f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

Release files / chesslib-1.0.329518997-cp35-cp35m-manylinux2010_x86_64.whl

Download URL chesslib-1.0.329518997-cp35-cp35m-manylinux2010_x86_64.whl
Size 60.8 kB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
251f3851c914e2f21e802460745fbacc0430b70727278447c7f5051f128798ca
BLAKE2b-256 checksum
How to use checksums
c8e59e529b1d23910508cf416a8f5d442146f0b6878480b0450f682ba3709f7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

Release files / chesslib-1.0.329518997-cp35-cp35m-manylinux1_x86_64.whl

Download URL chesslib-1.0.329518997-cp35-cp35m-manylinux1_x86_64.whl
Size 50.7 kB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
2cd666a49ee0a2dc65f419fafe2b85fa869bace689f75d7b8919a9e9f6e0658e
BLAKE2b-256 checksum
How to use checksums
03cbccfe68196cf7047fa34bd193f9f6250713c98895ab295d9f5a3e984b458b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

Release history Release notifications | RSS feed

This release

1.0.329518997 This release

15 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