{"id":13705227,"url":"https://github.com/e-alizadeh/Zotero2Readwise","last_synced_at":"2025-05-05T13:30:41.524Z","repository":{"id":41893635,"uuid":"442956389","full_name":"e-alizadeh/Zotero2Readwise","owner":"e-alizadeh","description":"A Python Library to retrieve annotations and notes from Zotero and upload them to your Readwise.","archived":false,"fork":false,"pushed_at":"2024-02-22T02:49:32.000Z","size":142,"stargazers_count":155,"open_issues_count":18,"forks_count":30,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T12:07:11.545Z","etag":null,"topics":["readwise","zotero"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/e-alizadeh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-30T03:33:58.000Z","updated_at":"2025-04-03T08:37:29.000Z","dependencies_parsed_at":"2023-11-16T04:26:10.811Z","dependency_job_id":"82e02b07-967c-4247-9f42-fce2236f6982","html_url":"https://github.com/e-alizadeh/Zotero2Readwise","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-alizadeh%2FZotero2Readwise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-alizadeh%2FZotero2Readwise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-alizadeh%2FZotero2Readwise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-alizadeh%2FZotero2Readwise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/e-alizadeh","download_url":"https://codeload.github.com/e-alizadeh/Zotero2Readwise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252506353,"owners_count":21759033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["readwise","zotero"],"created_at":"2024-08-02T22:00:35.727Z","updated_at":"2025-05-05T13:30:41.265Z","avatar_url":"https://github.com/e-alizadeh.png","language":"Python","funding_links":["https://www.buymeacoffee.com/ealizadeh"],"categories":["Python","Tools"],"sub_categories":["Zotero"],"readme":"# Zotero ➡️ Readwise\n\n`zotero2readwise` is a Python library that retrieves all [Zotero](https://www.zotero.org/) annotations† and notes. \nThen, It automatically uploads them to your [Readwise](https://readwise.io/)§. \n\nThis is particularly useful for the new [Zotero PDF Reader](https://www.zotero.org/support/pdf_reader_preview) \nthat stores all highlights in the Zotero database. \nThe new Zotero, also available for [iOS app](https://www.zotero.org/iosbeta) (currently in beta). \nIn the new Zotero, the annotations are NOT saved in the PDF file unless you export the highlights in order to save them.\n\nIf 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.\n\n**_This library is for you if you annotate (highlight + note) using the Zotero's PDF reader (including the Zotero iOS)_**\n\n👉***Updating an existing Zotero annotation or note and re-running this library will update the corresponding Readwise highlight without creating a duplicate!***\n\n† Annotations made in the new Zotero PDF reader and note editor.\n\n§ Readwise is a _paid_ service/software that integrates your highlights from almost everywhere (Pocket, Instapaper, Twitter, Medium, Apple Books, and many more). \nIt even has an amazing OCR for directly importing your highlights on a physical book/article into Readwise and allowing \nyou to export all your highlights to Obsidian, Notion, Roam, Markdown, etc. \nMoreover, It has an automated [Spaced Repition](https://en.wikipedia.org/wiki/Spaced_repetition) and [Active Recall](https://en.wikipedia.org/wiki/Testing_effect). \n\n---\n\n\n# Installation \nYou can install the library by running \n```shell\npip install zotero2readwise\n```\n\nNote: If you do not have pip installed on your system, you can follow the instructions [here](https://pip.pypa.io/en/stable/installation/).\n\n\n# Usage\nSince we have to retrieve the notes from Zotero API and then upload them to the Readwise, the minimum requirements are:\n* **Readwise access token** [Required]: You can get your access token from https://readwise.io/access_token\n* **Zotero API key** [Required]: Create a new Zotero Key from [your Zotero settings](https://www.zotero.org/settings/keys/new)\n* **Zotero personal or group ID** [Required]: \n    * Your **personal library ID** (aka **userID**) can be found [here](https://www.zotero.org/settings/keys) next to `Your userID for use in API calls is XXXXXX`.\n    * If you're using a **group library**, you can find the library ID by \n        1. Go to `https://www.zotero.org/groups/`\n        2. Click on the interested group.\n        3. You can find the library ID from the URL link that has format like *https://www.zotero.org/groups/\u003cgroup_id\u003e/group_name*. The number between `/groups/` and `/group_name` is the libarry ID. \n* **Zotero library type** [Optional]: *\"user\"* (default) if using personal library and *\"group\"* if using group library.\n\nNote that if you want to retrieve annotations and notes from a group, you should provide the group ID (`zotero_library_id=\u003cgroup_id\u003e`) and set the library type to group (`zotero_library_type=\"group\"`).\n\n## Approach 1 (running a python script)\nFor this approach you can download `run.py` script (from [here](https://github.com/e-alizadeh/Zotero2Readwise/blob/master/zotero2readwise/run.py)). Run `python run.py -h` to get more information about all options. \nYou can simply run the script as the following:\n```shell\npython run.py \u003creadwise_token\u003e \u003czotero_key\u003e \u003czotero_id\u003e \n```\n\n## Approach 2 (through python terminal)\n```python \nfrom zotero2readwise.zt2rw import Zotero2Readwise\n\nzt_rw = Zotero2Readwise(\n    readwise_token=\"your_readwise_access_token\",  # Visit https://readwise.io/access_token)\n    zotero_key=\"your_zotero_key\",  # Visit https://www.zotero.org/settings/keys\n    zotero_library_id=\"your_zotero_id\", # Visit https://www.zotero.org/settings/keys\n    zotero_library_type=\"user\", # \"user\" (default) or \"group\"\n    include_annotations=True, # Include Zotero annotations -\u003e Default: True\n    include_notes=False, # Include Zotero notes -\u003e Default: False\n)\nzt_rw.run()\n```\nJust to make sure that all files are created, you can run `save_failed_items_to_json()` from `readwise` attribute of \nthe class object to save any highlight that failed to upload to Readwise. \nIf a file or more failed to create, the filename (item title) and the corresponding Zotero \nitem key will be saved to a txt file. \n```python\nzt_rw.readwise.save_failed_items_to_json(\"failed_readwise_highlights.json\")\n```\n---\n# [Zotero2Readwise-Sync](https://github.com/e-alizadeh/Zotero2Readwise-Sync)\n\n### 👉 Set up a scheduled automation once and forget about it!\n\nYou can fork my repo [Zotero2Readwise-Sync](https://github.com/e-alizadeh/Zotero2Readwise-Sync) repository that contain \nthe cronjob (time-based Job scheduler) using GitHub actions to automatically retrieve all your Zotero annotations/notes, \nand then push them to Readwise. \nYou can use the forked repo without even changing a single line (of course if you're happy with the default settings!)\n\n# Request a new feature or report a bug\nFeel free to request a new feature or report a bug in GitHub issue [here](https://github.com/e-alizadeh/Zotero2Readwise/issues).\n\n\n# 📫 How to reach me:\n\u003ca href=\"https://ealizadeh.com\" target=\"_blank\"\u003e\u003cimg alt=\"Personal Website\" src=\"https://img.shields.io/badge/Personal%20Website-%2312100E.svg?\u0026style=for-the-badge\u0026logoColor=white\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.linkedin.com/in/alizadehesmaeil/\" target=\"_blank\"\u003e\u003cimg alt=\"LinkedIn\" src=\"https://img.shields.io/badge/linkedin-%230077B5.svg?\u0026style=for-the-badge\u0026logo=linkedin\u0026logoColor=white\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://medium.ealizadeh.com/\" target=\"_blank\"\u003e\u003cimg alt=\"Medium\" src=\"https://img.shields.io/badge/medium-%2312100E.svg?\u0026style=for-the-badge\u0026logo=medium\u0026logoColor=white\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://twitter.com/intent/follow?screen_name=es_alizadeh\u0026tw_p=followbutton\" target=\"_blank\"\u003e\u003cimg alt=\"Twitter\" src=\"https://img.shields.io/badge/twitter-%231DA1F2.svg?\u0026style=for-the-badge\u0026logo=twitter\u0026logoColor=white\" /\u003e\u003c/a\u003e\n\n\u003ca href=\"https://www.buymeacoffee.com/ealizadeh\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-blue.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe-alizadeh%2FZotero2Readwise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe-alizadeh%2FZotero2Readwise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe-alizadeh%2FZotero2Readwise/lists"}