I am studying chess. I am reading some books and playing over the board, but most of the time I am playing, solving puzzles and analyzing games on Lichess. At this moment there are more than 8000 games on my history there. I decided to check some things using the Lichess API. Perhaps this code can be useful for you too.
The code will be always divided into scripts which obtain data from Lichss API (and save it to /data) and
scripts to plot different charts. So, if you run player_games_charts.py it will asume that there are .csv
files in /data and a player's .json file in /config.
When you run player_games_data.py you need a lichess.json file in /config which contains your api token.
{
"api_client": "berserk-downstream",
"token": "No, I won't tell you my token.",
"maxgames": 10000
}
{
"name": "Rodrigo Valla",
"username": "rvalla",
"start_year": 2021,
"start_month": 9,
"start_day": 1,
"end_year": 2022,
"end_month": 3,
"end_day": 1,
"previous_data" : true
}
This little project is possible thanks to a lot of work done by others in the open-source community. Particularly in this case I need to mention:
- Lichess: the best place to learn and play chess.
- Python: the programming language I used.
- Berserk: the client I used to comunicate with Lichess API.
Feel free to contact me by mail or reach me in telegram or mastodon.