Skip to main content

♟ Welcome to beth documentation

beth is an open source chess AI framework. Like many, I re-discovered the game of chess by watching the Netflix show the Queen's Gambit. As a Data Scientist, it made we want to learn and explore the beauty of the game.

At first my goal was to develop algorithms to help me learn chess. But over time, it lead to developing more and more features. What you will find is my personal experiments open sourced as a chess framework. I hope this framework to be ideal for chess programmers in Python to ease the development of new algorithms and engines.

This repo is under active development, many features are still experimental. But please fill free to fork or PR

Installation

You can install the library from PyPi with:

pip install beth

Or clone and install from source

Features

  • Definition of a game environment using python-chess framework, with move parsing, board-to-numpy abstractions, PGN records, move replay.
  • Playing chess in Jupyter notebooks with widgets
  • Different player abstractions: HumanPlayer(), RandomPlayer(), AIPlayer() - to play Human vs AI, Human vs Human, or AI vs AI.
  • Connection to Stockfis engine to evaluate engine performances, available with StockfishAI() object abstraction
  • Rules-based engine TreeSearchAI() with minimax tree search, alpha beta pruning, move ordering and board heuristics (~ELO 1000)
  • First attempt of ML engine with a LSTM Neural Network to predict next moves

Next roadmap features

If you are interested, please drop an issue or a PR, or contact me by email. Meanwhile the roadmap for beth is:

  • Implementing a GUI (or connecting to an existing one) to ease experimentation
  • ELO or TrueSkill measurement for any engine
  • Improving minimax engine speed
  • Developing ML engines:
    • Self supervised learning with Transformers
    • Reinforcement Learning

Repo Structure

- beth/
- data/
    - raw/
    - processed/
- docs/                             # Documentation folder and website (.md, .ipynb) using Mkdocs
- notebooks/                        # Jupyter notebooks only (.ipynb)
- tests/                            # Unitary testing using pytest
- .gitignore
- LICENSE                           # MIT License
- poetry.lock                       # Poetry lock file
- pyproject.toml                    # Configuration file to export and package the library using Poetry

Release files for beth 0.2.0

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

Source distribution (sdist)

Source distribution for beth 0.2.0
File Size Uploaded
beth-0.2.0.tar.gz 17.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beth 0.2.0
File Interpreter ABI Platform
beth-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.3 kB

Release files / beth-0.2.0.tar.gz

Download URL beth-0.2.0.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
585b265f1c679072adff06a42d6c9d545260292dd9ba2585c0fc25f35b4d4e96
BLAKE2b-256 checksum
How to use checksums
1402659f75a837fe9c8b885d4d95dc9a71437f9557d6c37612cfe02d576bf694
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.7.4 Windows/10

Release files / beth-0.2.0-py3-none-any.whl

Download URL beth-0.2.0-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f48eda38d02f6e63df26c0d5fe6bcd29a9649f5dfa42d874f92eb64acd22092b
BLAKE2b-256 checksum
How to use checksums
3de22ac46cf938093f7c64f72a7bec2563d2091a6db778c7cd57404414d4c259
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.7.4 Windows/10

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 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