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

Are new Zotero beta notes and annotations (not saved in the PDF) retrievable in Pyzotero? #148

Open
e-alizadeh opened this issue Dec 16, 2021 · 6 comments

Comments

@e-alizadeh
Copy link

No description provided.

@urschrei
Copy link
Owner

This is really a question for the Zotero Web API maintainers: I'm not aware of any Web API methods that allow retrieval of the annotations. The google group is probably the best place to ask: https://groups.google.com/g/zotero-dev

If there are methods available, I'll add them to Pyzotero.

@e-alizadeh
Copy link
Author

Thanks for your quick reply.
I further looked at this issue. Zotero beta stores annotations and highlights in their database as opposed to saving them in the PDF files itself. These new annotations are available in Zotero's new PDF editor.

As per following discussion (https://forums.zotero.org/discussion/90753/zotero-beta-integration-with-external-note-taking-tools), web API access to all annotations made in the new PDF editor is available even now. However, annotations aren't yet documented in the web API docs, even though Zotero itself syncs them via the API as a new item type.

Thanks again

@urschrei
Copy link
Owner

Yep, this is the tracking issue: zotero/dataserver#113.

In the mean time, retrieving annotations using items(itemType='annotation') for an initial dump (which you could dump to JSON along with the library version), and then items(itemType='annotation, since=library_version) to get updates is a bit convoluted, but will work: retrieved annotations have a parentItem key in data that you can use for matching. You then also have to rebuild the annotation images from the raw data (easy in case of rects, more complicated for freehand shapes)…

@e-alizadeh
Copy link
Author

e-alizadeh commented Dec 19, 2021

How can I retrieve all annotations? Calling items(itemType="annotation") returns 100 items only. Even passing limit with a higher number than 100 still returns 100 annotations.
When calling count_items(), I can see that the number increases when I'm adding a new annotations, and I can see the new annotation when calling items(itemType="annotation") as first items. However, I'm not able to retrieve older annotations to start with!!

@urschrei
Copy link
Owner

urschrei commented Dec 19, 2021 via email

@e-alizadeh
Copy link
Author

e-alizadeh commented Dec 19, 2021

Thanks a lot. all_annotations = zot.everything(zot.items(itemType="annotation")) seems to return all annotations as you suggested. I was not using everything() func properly before.

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

2 participants