Skip to content
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 Studies #157

Open
jynfairchild opened this issue Dec 13, 2021 · 5 comments
Open

API for Studies #157

jynfairchild opened this issue Dec 13, 2021 · 5 comments

Comments

@jynfairchild
Copy link

I would like an API that,

  • Allows creation of a New Study
  • Has study settings, as params, in the request call.
  • Allows for adding of new chapters (specifically the PGN upload)
  • Allows for auto-enabling"analyze each chapter"

I've built a system that pulls all games for a particular player (OTB games) from tournament sites and consolidates them into a single PGN. I then want a way of creating a study, uploading the PGN, and auto run the engine against each game (chapter), returning a link to that study.

Thank you!

@stevecheckoway
Copy link

A full REST API for studies would be nice.

My desired use is

  1. download a random assortment of interactive lesson chapters from my private studies;
  2. create a new (or replace an existing) study; and
  3. add the chapters to the study.

@mratanusarkar
Copy link

I have the same requirement. I would like to have an API where I can upload multiple games, positions, studies, and puzzles to Lichess. And most importantly, a way to classify and organize all the uploads into one study, chapter-wise in a logical manner via API, instead of doing it manually, which is so tedious and time-consuming.

for example, the below code uploads a PGN to Lichess, but it only returns a single link to the upload.

# pgn_text = imported pgn file
headers = {
    "Content-Type": "application/x-www-form-urlencoded",
    "Authorization": "Bearer " + YOUR_API_KEY
}
body = {
    "pgn": pgn_text
}
response = requests.post(LICHESS_API_URL, headers=headers, data=body)

If only there was a way to collect all these links and pass it through another API to get them organized into a Study, chapter-wise, or do a bulk upload of all the PGNs together and pass in a JSON that would structure the uploads and organize them into a study.

@sertaco
Copy link

sertaco commented Oct 15, 2023

Hi all,

Have you had a solution to this issue?

Right now Lichess has an import PGN api into an existing study: https://lichess.org/api#tag/Studies/operation/apiStudyImportPGN

I would like to be able to create a new study at least. Is this possible?

@jlkhermes38
Copy link

Hi all, thanks for the work you have been doing.
I agree with comments in this thread, it would be great to enrich this API also allowing to import FEN as a new chapter, modify the parameters of the chapter and allowing to change the metadata.

Thanks

@mratanusarkar
Copy link

long ago, I recall creating a detailed issue on the same, with some ideas on what the API could be like.
I will link it here so that everyone can take a look. Issue: #224

If I get some time in the future, I will try to implement the same and raise a PR.
In the meantime, if anyone is interested, feel free to go ahead and start... and I might join in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants