title: Chessli2
emoji: π°
colorFrom: blue
colorTo: red
sdk: gradio
app_file: src/chessli2/app.py
python_version: 3.11
pinned: true
Welcome to Chessli2 π°
chessli2 is your always free and open-source chess trainer π‘οΈ, designed to elevate your game by allowing you to analyze games, identify mistakes, and sharpen your tactics, all sourced directly from lichess.org.
Why a second version?
Incredibly, despite my prolonged absence, I continue to receive heartfelt π thank you notes and eager requests for chessli.
This overwhelming support has inspired me to develop a sleek new version of chessli
that not only squashes all those pesky bugs π but also introduces a user-friendly graphical interface. This means no programming experience is required to dive in!
Features π
- Automatically fetch your games and played tactics puzzles from lichess via the berserk python client for the Lichess API! π
- Find your mistakes by parsing and analyzing your games with python-chess π
- Leverage the power of spaced repetition using Anki with this amazing interactive chess template: Anki-Chess-2.0 π§
- And everything with a beautiful GUI thanks to gradio
Chessli2 is here to support your journey to becoming a chess master. Dive in and start enhancing your skills today! π
Quickstart π
π Click here to try out the app directly without any setup:
π Inspect code at:
- GitHub: pwenker/chessli2
- Hugging Face Spaces: pwenker/chessli2
π Best 1000 Puzzles for each Theme π§©
π Overview and links π
Local Deployment π
Prerequisites π
Rye πΎ
Rye is a comprehensive tool designed for Python developers. It simplifies your workflow by managing Python installations and dependencies. Simply install Rye, and it takes care of the rest.
Set-Up π οΈ
Clone the repository, e.g. with:
git clone https://github.com/pwenker/chessli2.git
Navigate to the directory:
cd chessli2
And execute:
rye sync
This creates a virtual environment in .venv
and synchronizes the repo.
For more details, visit: Basics - Rye
Start the App π
If you choose to install
chessli2
withoutrye
just omitrye run
for the following commands.
Launch the app using:
rye run python src/chessli2/app.py
Finally, open your browser and visit http://localhost:7860 to start practicing!
Programmatic Access
API endpoints
Thanks to Gradio, you can find an API documentation for chessli2
at Chessli2 API.
CLI
There is also a CLI!
rye run chessli2 --help
For complete usage information of all commands and options, take a look at the CLI documentation at docs/cli.md.
FAQ
ποΈ How to Obtain Your Lichess API Token
:zap: Fast route: Simply click this pre-filled URL for a quick set-up with the correct token space: https://lichess.org/account/oauth/token/create?scopes[]=puzzle:read&description=My+token+for+chessli2
To acquire a personal API token for the Lichess platform, simply follow these steps:
- Create a Lichess Account π: If you don't already have one, create a Lichess account by visiting lichess.org and signing up.
- Log In π: After setting up your account, log in and navigate to your account settings.
- Access Token Settings π§: Proceed to the 'API Access Tokens' section, typically found under a menu related to tools or personal settings. You can directly access it via https://lichess.org/account/oauth/token.
- Create a New Token π: Click on the button to create a new token. You'll need to specify the scopes or permissions that the token should have. These permissions determine what actions your token can perform on your behalf. For
chessli2
it is currently sufficient to permit "Read Puzzle Activity" and "Read Preferences". - Name Your Token π·οΈ: Assign a meaningful name to your token for easy identification, especially useful if managing multiple tokens.
- Generate the Token π: After selecting the necessary scopes and naming your token, click to generate it. Lichess will display your new API token.
- Copy and Secure Your Token π: Ensure you copy and securely store your token. Do not share it, as it grants access to your Lichess account based on the selected scopes. Remember, Lichess will not display the token again once you navigate away from the page.
- Use the Token π: You can now use this token by pasting it into the "Lichess API token" field within the
chessli2
interface
π¨ Important: If your token is ever compromised or no longer needed, revoke it immediately to secure your account.
π How to Get Anki Cards from My Mistakes?
π Create a CSV File
- After you've fetched your mistakes with
chessli2
, a "Download CSV" button will appear. - Click this button and store the
CSV
file at a location of your choosing.
π Set-up Anki-Chess-2.0
- Next, you will need to set up Anki-Chess-2.0. This is the Anki chess template that is needed to visualize your mistakes within Anki with a beautiful interactive chess board.
- While you are there, why not leave a star β to show the maintainer that you value the chess template, or send a nice message? π Since the beginnings of
chessli
, the chess template has always been a crucial part!
π₯ Import the CSV into Anki
Finally, you can import the CSV file into Anki.
- Launch the Anki application on your computer.
- Choose or create the deck into which you want to import the CSV file.
- Click on the deck name to open it.
- In the main Anki window, go to the menu bar and click on
File
. - Select
Import...
from the dropdown menu. - Browse to the location of your CSV file, select it, and click
Open
. - Anki will open a dialog box asking how you want to import the CSV file. Select the
Chess-2.0
note type. And select "Fields separated by: Comma". - Make sure it reads: "Field 1 of file is: mapped to PGN" (For the puzzles you can map the second field to "Tags")
- Click the
Import
button. Anki will process the file and add the new cards to the selected deck. - After importing, itβs a good idea to review a few cards to ensure they were imported correctly. You can do this by browsing the deck or starting a study session.
- Pat yourself on the back! You did it! π