Sefaria-Project icon indicating copy to clipboard operation
Sefaria-Project copied to clipboard

Allow specifying which commentaries to return when calling `texts/:ref?commentary=1`

Open M-Zuber opened this issue 5 years ago • 3 comments

The list of commentaries that is returned can be exceptionally large, and often the use case for the api consumer is limited to a small subset. It would be convenient to be able to specify a subset of commentaries.

For example, if I want to use the api to get todays Aliyah for Shnayim Mikrah with Rashi, I have to make 3 calls https://www.sefaria.org/api/texts/Genesis.28.10-22?context=0 https://www.sefaria.org/api/texts/Onkelos_Genesis.28.10-22?context=0 https://www.sefaria.org/api/texts/Rashi_on_Genesis.28.10-22?context=0 and reduce the results into a single array.

M-Zuber avatar Nov 25 '20 10:11 M-Zuber

This is a great idea for a pull request. I agree that this is an issue but it is low priority for us since there is a workaround and it is not a bug in our site. The API is defined here: https://github.com/Sefaria/Sefaria-Project/blob/master/reader/views.py#L1204 Feel free to post comments if you have questions on the code.

nsantacruz avatar Nov 25 '20 10:11 nsantacruz

I would have to learn Python first so if someone wants to go first, please feel free

M-Zuber avatar Nov 25 '20 16:11 M-Zuber

זה אמנם לא באג, אבל זה שיפור נחוץ מאוד לפחות לחלק את הפרשנים ל'ראשונים' ו'אחרונים' אני לא צריך למשוך אלפי פרשנים כשאני צריך בסך הכל רש"י ורמב"ן

nhw80697 avatar Dec 21 '21 20:12 nhw80697