applechess


Nameapplechess JSON
Version 0.1 PyPI version JSON
download
home_pageNone
SummaryA simple alpha-beta chess engine with a Lichess bot interface.
upload_time2024-03-23 02:43:20
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords chess engine alpha beta minimax applechess apple pruning
VCS
bugtrack_url
requirements chess berserk python-dotenv sphinx myst_parser furo
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Applechess

Applechess is a simple chess engine, written using the minimax and alpha-beta pruning algorithms along with a handcrafted heuristics function.

See more information about the two algorithms on the Wikipedia pages: [minimax](https://en.wikipedia.org/wiki/Minimax) and [alpha-beta pruning](https://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning).

The easiest way to play the engine is to [play the bot on Lichess](https://lichess.org/@/apple-chess) by sending it a challenge request (variants and ultrabullet are not yet supported).
The engine may run slow if too many people are playing it. If the bot is offline, you can run it locally. 

## Running Applechess Locally

In order to run the engine locally, first install Python from [python.org](https://python.org) or your package manager.
Python 3.10+ is required.

Then, clone and install the requirements. You can optionally create a virtual environment before installing the packages.
```bash
git clone https://github.com/appleplectic/applechess.git
cd applechess
python -m pip install -r requirements.txt
```

To use the `ChessAgent` class:
```python
from applechess.chess_agent import ChessAgent

agent = ChessAgent()
agent.interactive_terminal()
```
Check the documentation for usage details. Note that the API is not stable, and will change frequently.

### Running the Lichess bot locally

Follow the same instructions above to clone and install dependencies.

Next, create a Lichess bot account by first [registering on lichess.org](https://lichess.org/signup) and then obtaining a personal access token under settings.

Upgrade the account to a bot account by running the following command (an account with any games on it cannot become a bot account):
```bash
curl -d '' https://lichess.org/api/bot/account/upgrade -H "Authorization: Bearer <yourTokenHere>"
```

Finally, create a `.env` file in either the root directory or the applechess/ directory with the following contents:
```
LICHESS_API_KEY=<yourTokenHere>
```

The bot should be ready to run:
```bash
cd applechess
python lichess_bot.py
```

### Building the Documentation
First, follow the previous instructions to download the dependencies.

Then, build the docs:
```bash
sphinx-build -M html docs/source/ docs/build/
```

The built docs should then be available in `docs/build/html/`.

## Licensing and Contributing

Contributions are encouraged - create a pull request or issue!

See the `LICENSE` file for licensing information. All contributions will be under the same license.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "applechess",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "chess, engine, alpha, beta, minimax, applechess, apple, pruning",
    "author": null,
    "author_email": "Levin Ma <llmar1000000@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/8f/9a/9e389ceb753456079529858eed1cc7daf7af5fffeeeeba779a29f7892a97/applechess-0.1.tar.gz",
    "platform": null,
    "description": "# Applechess\r\n\r\nApplechess is a simple chess engine, written using the minimax and alpha-beta pruning algorithms along with a handcrafted heuristics function.\r\n\r\nSee more information about the two algorithms on the Wikipedia pages: [minimax](https://en.wikipedia.org/wiki/Minimax) and [alpha-beta pruning](https://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning).\r\n\r\nThe easiest way to play the engine is to [play the bot on Lichess](https://lichess.org/@/apple-chess) by sending it a challenge request (variants and ultrabullet are not yet supported).\r\nThe engine may run slow if too many people are playing it. If the bot is offline, you can run it locally. \r\n\r\n## Running Applechess Locally\r\n\r\nIn order to run the engine locally, first install Python from [python.org](https://python.org) or your package manager.\r\nPython 3.10+ is required.\r\n\r\nThen, clone and install the requirements. You can optionally create a virtual environment before installing the packages.\r\n```bash\r\ngit clone https://github.com/appleplectic/applechess.git\r\ncd applechess\r\npython -m pip install -r requirements.txt\r\n```\r\n\r\nTo use the `ChessAgent` class:\r\n```python\r\nfrom applechess.chess_agent import ChessAgent\r\n\r\nagent = ChessAgent()\r\nagent.interactive_terminal()\r\n```\r\nCheck the documentation for usage details. Note that the API is not stable, and will change frequently.\r\n\r\n### Running the Lichess bot locally\r\n\r\nFollow the same instructions above to clone and install dependencies.\r\n\r\nNext, create a Lichess bot account by first [registering on lichess.org](https://lichess.org/signup) and then obtaining a personal access token under settings.\r\n\r\nUpgrade the account to a bot account by running the following command (an account with any games on it cannot become a bot account):\r\n```bash\r\ncurl -d '' https://lichess.org/api/bot/account/upgrade -H \"Authorization: Bearer <yourTokenHere>\"\r\n```\r\n\r\nFinally, create a `.env` file in either the root directory or the applechess/ directory with the following contents:\r\n```\r\nLICHESS_API_KEY=<yourTokenHere>\r\n```\r\n\r\nThe bot should be ready to run:\r\n```bash\r\ncd applechess\r\npython lichess_bot.py\r\n```\r\n\r\n### Building the Documentation\r\nFirst, follow the previous instructions to download the dependencies.\r\n\r\nThen, build the docs:\r\n```bash\r\nsphinx-build -M html docs/source/ docs/build/\r\n```\r\n\r\nThe built docs should then be available in `docs/build/html/`.\r\n\r\n## Licensing and Contributing\r\n\r\nContributions are encouraged - create a pull request or issue!\r\n\r\nSee the `LICENSE` file for licensing information. All contributions will be under the same license.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A simple alpha-beta chess engine with a Lichess bot interface.",
    "version": "0.1",
    "project_urls": {
        "Documentation": "https://appleplectic.github.io/applechess/",
        "Homepage": "https://github.com/appleplectic/applechess",
        "Issues": "https://github.com/appleplectic/applechess/issues",
        "Repository": "https://github.com/appleplectic/applechess.git"
    },
    "split_keywords": [
        "chess",
        " engine",
        " alpha",
        " beta",
        " minimax",
        " applechess",
        " apple",
        " pruning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a280f9f11a5f94f88024b1d3fd3a615e5eb89873cc4ebde72d8ed558b0f6876a",
                "md5": "6dabbcb0c387a1ee20536a27336afade",
                "sha256": "76d6a7d3eb1c30fd1ff132e41195b1957feae25319b3cf67aa58e8c9fbdf207f"
            },
            "downloads": -1,
            "filename": "applechess-0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6dabbcb0c387a1ee20536a27336afade",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 21747,
            "upload_time": "2024-03-23T02:43:18",
            "upload_time_iso_8601": "2024-03-23T02:43:18.468785Z",
            "url": "https://files.pythonhosted.org/packages/a2/80/f9f11a5f94f88024b1d3fd3a615e5eb89873cc4ebde72d8ed558b0f6876a/applechess-0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8f9a9e389ceb753456079529858eed1cc7daf7af5fffeeeeba779a29f7892a97",
                "md5": "62de2873b86cdef6833c71496bedb659",
                "sha256": "655878d4ed757cf94920aba1b4edfa97973de131720d293b94fbd7be553a4972"
            },
            "downloads": -1,
            "filename": "applechess-0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "62de2873b86cdef6833c71496bedb659",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 22381,
            "upload_time": "2024-03-23T02:43:20",
            "upload_time_iso_8601": "2024-03-23T02:43:20.251835Z",
            "url": "https://files.pythonhosted.org/packages/8f/9a/9e389ceb753456079529858eed1cc7daf7af5fffeeeeba779a29f7892a97/applechess-0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-23 02:43:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "appleplectic",
    "github_project": "applechess",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "chess",
            "specs": [
                [
                    "~=",
                    "1.10.0"
                ]
            ]
        },
        {
            "name": "berserk",
            "specs": [
                [
                    "~=",
                    "0.13.2"
                ]
            ]
        },
        {
            "name": "python-dotenv",
            "specs": [
                [
                    "~=",
                    "1.0.1"
                ]
            ]
        },
        {
            "name": "sphinx",
            "specs": [
                [
                    "~=",
                    "7.2.6"
                ]
            ]
        },
        {
            "name": "myst_parser",
            "specs": [
                [
                    "~=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "furo",
            "specs": [
                [
                    "~=",
                    "2024.1.29"
                ]
            ]
        }
    ],
    "lcname": "applechess"
}
        
Elapsed time: 0.25341s