currently I am looking with python to do a failure "ia" which gives me the opening with the best success rate (using the grand master parts of the lichess database) with a minmax and by taking only the moves with at least 100 position already played so as not to fall on a 100% black success rate with 1 single game. I managed to do it with the lichess api, the problem is that when I request more than 3 depth, lichess blocks me because of spam generated on the api.
I told myself that I was going to do the same thing but instead of using the lichess api, I was going to use a .pgn of grand masters parts and with the library "chess" I could do something similar but currently I am blocked on how to filter this file on by example "e2-e4" and have the success rate of each move and have a recursive function to explore this file.
I can't find a solicitation through the chess-py doc and my googles searches don't come up with anything.
Does someone have an idea ?
api lichess : https://lichess.org/api#tag/Opening-Explorer
png file : https://odysee.com/@Toadofsky:b/Lichess-Elite-Database:b
Here is an example with the indications of @fougueux (I hadn't thought about creating a database with this file and I missed the "erd" code which is exactly what I need)
Fill the database (dbname = "game", row id, row fen, row result)
And algorithm for search minmax score (score = %winrate white * 1, + %winrate black * 0, + %winrate draw * 0.5), he take a move with more 100 move plays
being more comfortable with php than python I made the select of the fen via this code:
Thank you for helping :)