Parsing and importing many items to Zotero

I've got a JSON with 5000+ articles with metadata and full texts. I would like to load them to a Zotero group, preferably with full-text content.

I used Pyzotero to convert the contents to journal article items and then generate items in the group; unfortunately, API only supports creating 50 items per call, and uploading file attachments (even really lightweight .txt files) takes a while.

- Is there are any ways to speed things up with the API a bit, or at least time commands smartly so that I don't have to constantly keep an eye on my script?
- Is there any other way to parse items and load into Zotero (preferably with full-text attachments) that does not involve API?

Additionally, though I'm not certain this question fits here, is Pyzotero capable of creating an item in a collection right away? Because AFAIK one may only create an item in the group's "root" and only then move it to a group's collection.
  • Why do you have to keep an eye on the script? The script should just upload the batches serially. Most web APIs have request size limits, but that has no bearing on whether something can be automated.

    It's possible to script this locally, of course, but the web API is fully documented and the JS API is not, so unless you want to dig into the Zotero source code for how to do things like adding attachments, you're probably better off with the web API.

    Maybe a bit late for this, but another option would be to just convert the JSON into an import format supported by Zotero such as RIS or BibTeX. I believe we support file import via local path for both of those.
    Additionally, though I'm not certain this question fits here, is Pyzotero capable of creating an item in a collection right away? Because AFAIK one may only create an item in the group's "root" and only then move it to a group's collection.
    I don't know about pyzotero, but the API certainly allows items to be assigned to collections on creation.
  • Thank you for the answers!

    I've tried serializing it and the Colab notebook I ran stopped soon (without throwing any explicit error), and I assumed there was some limitation I wasn't aware of. I will look into that and try again.

    As for converting to some import format - I considered this but also thought there was no way to automatically add file attachments this way. I may have been too focused on CSL JSON though.
  • Yes, CSL-JSON is specifically for citations and doesn't know anything about attachments.
  • BBT JSON does know about attachments. It's mostly just a dump of the items as they're handed to translators with cleanup. I use it in my test framework, but when BBT is installed it's available as any other import/export format.
Sign In or Register to comment.