Skip to content

Commit

Permalink
Merge pull request #6 from e-alizadeh/master
Browse files Browse the repository at this point in the history
fix: uploading only 5 items!
  • Loading branch information
e-alizadeh authored Jan 1, 2022
2 parents a2d117b + dc78be3 commit 25cd8ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ If you annotate your files outside the new Zotero PDF reader, this library may n

**_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 a _paid_ service/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 automated [Spaced Repition](https://en.wikipedia.org/wiki/Spaced_repetition) and []Active Recall](https://en.wikipedia.org/wiki/Testing_effect). You can use the the link [here](https://readwise.io/i/essi) to get an extra free month (*Disclaimer: I will get a free month too!*)
§ Readwise is a _paid_ service/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 automated [Spaced Repition](https://en.wikipedia.org/wiki/Spaced_repetition) and [Active Recall](https://en.wikipedia.org/wiki/Testing_effect). You can use the the link [here](https://readwise.io/i/essi) to get an extra free month (*Disclaimer: I will get a free month too!*)

---

Expand Down Expand Up @@ -51,17 +55,16 @@ zt_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/keys
zotero_library_id="your_zotero_id", # Visit https://www.zotero.org/settings/keys
zotero_library_type="user", # "user" or "group"
zotero_library_type="user", # "user" (default) or "group"
include_annotations=True, # Include Zotero annotations -> Default: True
include_notes=False, # Include Zotero notes -> Default: False
)
zt_rw.run_all()
zt_rw.run()
```

## Approach 2:
## Approach 2
You can use the `run.py` script. Run `python run.py -h` to get more information about all options.
You can simply run the script as the following:

```shell
python run.py <readwise_token> <zotero_key> <zotero_id>
```
Expand Down
6 changes: 3 additions & 3 deletions zotero2readwise/zt2rw.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def get_all_zotero_items(self) -> List[Dict]:
print(f"{len(all_zotero_items)} Zotero items are retrieved.")
return all_zotero_items

def run_all(self) -> None:
zot_annots_notes = self.get_all_zotero_items()
zot_annots_notes = zot_annots_notes[0:5]
def run(self, zot_annots_notes: List[Dict] = None) -> None:
if zot_annots_notes is None:
zot_annots_notes = self.get_all_zotero_items()
formatted_items = self.zotero.format_items(zot_annots_notes)
if self.zotero.failed_items:
self.zotero.save_failed_items_to_json("failed_zotero_items.json")
Expand Down

0 comments on commit 25cd8ec

Please sign in to comment.