urschrei / pyzotero

Pyzotero: a Python client for the Zotero API
https://pyzotero.readthedocs.org
Other
908 stars 99 forks source link

Using collection_items function to retrieve more than 100 items #160

Closed JorrisonFord closed 1 year ago

JorrisonFord commented 1 year ago

Hey there,

I am using pyzotero to retrieve two collections and compare their items. I can retrieve the entries if I apply the collection_items function to the Zotero object with the respective collection ID. However, the function is limited to 100 entries. I tried changing the limit parameter to 500, but I still get 100 entries. If I set a limit of 50, I can retrieve 50, so the parameter generally works. Below I have included the line of code that I used. Is there something I am missing or is the function generally unable to retrieve more than 100 items? When I filter for the tag in Zotero, I retrieve 124 items.

included_items_1 = zot_1.collection_items(collection_id_1, tag = "include", limit = 500)

urschrei commented 1 year ago

You can try wrapping the calls in zotero.everything: https://pyzotero.readthedocs.io/en/latest/index.html?highlight=Everything#zotero.Zotero.everything

JorrisonFord commented 1 year ago

Thanks for the fast reply and your help! I made it work by using your suggestion.