Package: zotero2readwise
Zotero ➡️ Readwisezotero2readwiseis a Python library that retrieves allZoteroannotations† and notes.
Then, It automatically uploads them to yourReadwise§.This is particularly useful for the newZotero PDF Readerthat stores all highlights in the Zotero database.
The new Zotero, also available foriOS app(currently in beta).
In the new Zotero, the annotations are NOT saved in the PDF file unless you export the highlights in order to save them.If you annotate your files outside the new Zotero PDF reader, this library may not work with your PDF annotations as those are not retrievable from Zotero API.This library is for you if you annotate (highlight + note) using the Zotero's PDF reader (including the Zotero iOS)👉Updating an existing Zotero annotation or note and re-running this library will update the corresponding Readwise highlight without creating a duplicate!† Annotations made in the new Zotero PDF reader and note editor.§ Readwise is apaidservice/software that integrates your highlights from almost everywhere (Pocket, Instapaper, Twitter, Medium, Apple Books, and many more).
It even has an amazing OCR for directly importing your highlights on a physical book/article into Readwise and allowing
you to export all your highlights to Obsidian, Notion, Roam, Markdown, etc.
Moreover, It has an automatedSpaced RepitionandActive Recall.InstallationYou can install the library by runningpipinstallzotero2readwiseNote: If you do not have pip installed on your system, you can follow the instructionshere.UsageSince we have to retrieve the notes from Zotero API and then upload them to the Readwise, the minimum requirements are:Readwise access token[Required]: You can get your access token fromhttps://readwise.io/access_tokenZotero API key[Required]: Create a new Zotero Key fromyour Zotero settingsZotero personal or group ID[Required]:Yourpersonal library ID(akauserID) can be foundherenext toYour userID for use in API calls is XXXXXX.If you're using agroup library, you can find the library ID byGo tohttps://www.zotero.org/groups/Click on the interested group.You can find the library ID from the URL link that has format likehttps://www.zotero.org/groups/<group_id>/group_name. The number between/groups/and/group_nameis the libarry ID.Zotero library type[Optional]:"user"(default) if using personal library and"group"if using group library.Note that if you want to retrieve annotations and notes from a group, you should provide the group ID (zotero_library_id=<group_id>) and set the library type to group (zotero_library_type="group").Approach 1 (running a python script)For this approach you can downloadrun.pyscript (fromhere). Runpython run.py -hto get more information about all options.
You can simply run the script as the following:pythonrun.py<readwise_token><zotero_key><zotero_id>Approach 2 (through python terminal)fromzotero2readwise.zt2rwimportZotero2Readwisezt_rw=Zotero2Readwise(readwise_token="your_readwise_access_token",# Visit https://readwise.io/access_token)zotero_key="your_zotero_key",# Visit https://www.zotero.org/settings/keyszotero_library_id="your_zotero_id",# Visit https://www.zotero.org/settings/keyszotero_library_type="user",# "user" (default) or "group"include_annotations=True,# Include Zotero annotations -> Default: Trueinclude_notes=False,# Include Zotero notes -> Default: False)zt_rw.run()Just to make sure that all files are created, you can runsave_failed_items_to_json()fromreadwiseattribute of
the class object to save any highlight that failed to upload to Readwise.
If a file or more failed to create, the filename (item title) and the corresponding Zotero
item key will be saved to a txt file.zt_rw.readwise.save_failed_items_to_json("failed_readwise_highlights.json")Zotero2Readwise-Sync👉 Set up a scheduled automation once and forget about it!You can fork my repoZotero2Readwise-Syncrepository that contain
the cronjob (time-based Job scheduler) using GitHub actions to automatically retrieve all your Zotero annotations/notes,
and then push them to Readwise.
You can use the forked repo without even changing a single line (of course if you're happy with the default settings!)Request a new feature or report a bugFeel free to request a new feature or report a bug in GitHub issuehere.📫 How to reach me: