Closed RajjSinghh closed 2 years ago
I think this is a really good idea, but for the reasons we discussed elsewhere (namely Lichess rate limiting) I won't merge now. Until rate limiting is solved and a front end is available, merging would reduce usability for current users, so it doesn't make sense to merge now.
That said, it would be extremely useful if the rate limiting issues would be solved, so I will advertise the branch on the readme.
Changes made:
Printer
class was modified. The class no longer produces outputs in a file and instead returns the formatted PGN as a string.Grower.run
was modified to now be passed an opening book as an argument rather than reading it from the file. This means that the method can be called on different opening books without the need to change config.yaml. This change and the one above do not affect how the program runs, other than printing the output to the terminal instead of in standalone files.grower.run()
in a POST method using Flask. Now a front end needs to just send a POST request to 127.0.0.1:5000/sendpgn and will receive the string output fromPrinter.print()
. This can then be formatted however a user wants in the front end.Essentially, all of these changes make the original BookBuilder.py program accessible over the web. After that anyone can fork and build a front end using the /sendpgn route.