-
-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API for uploading puzzles and studies #224
Comments
I tried exploring the problem using APIs available from Lichess like https://lichess.org/api/import On exploring, I found that Lichess has a UI version of what I was looking for at https://lichess.org/study Please refer to the UI version below, |
update: I had a workaround for this issue. I went ahead and understood how PGN files work and how we can use multiple FEN in one game PGN to create positions of interest, and also store all metadata, annotations, markers, game info, and almost everything you can think of chess related, you can embed those data into a PGN, if you follow the format and the structure. and if done correctly, you can manually generate for the upload problem, how I tackled it was, just using the https://lichess.org/api/import API endpoint. uploaded_url_list = []
# your upload loop
uploaded_url_list.append(response.json()['url']) and those would be links to your study uploads. but still, there is a scope for a dedicated Lichess API for studies (eg: https://lichess.org/api/study), |
What's your use case? Why do you need it, what are you building, and how will people use it? |
@ornicar below are some rough answers to your question:
My use case consists of various algorithms and automation scripts that pick up some important positions from given sets of games (offline or online games), and based on some clustering logic, group the findings (findings from my algorithm or automation scripts) into logical groups and categories which can be converted into studies (almost like a book of study with chapters and games!), that can help in chess preparations.
I can't reveal much as this project is in collab with some GM and falls under NDA.
The Lichess GUI for Study is already quite sufficient and capable of handling a wide range of "study creation" scenarios. But having the same capability via an API would be powerful and help in various automation and upload scenarios (like one(s) in my use-case) |
Just like Lichess has APIs for downloading puzzles, it would be helpful if we had an API for upload, so that:
For example: In case of single uploads, we can pass a JSON in the body with the single upload "ids" or "lichess upload urls", puzzle names, chapter names, and the title of the study. The JSON structure would be used to group them into chapters and order the chapters into one study.
For bulk upload, we can have a similar implementation and pass the information on how to organize the data in a JSON.
Note: The upload file type would be in PGN or FEN
If something similar already exists or there is a workaround, please help me out with the same.
The text was updated successfully, but these errors were encountered: