complete-computing-environment/kobo_aura_one.org

60 lines
1.5 KiB
Org Mode

:PROPERTIES:
:ID: cce/kobo_aura_one
:ROAM_ALIASES: "E-Reader Stats and Annotations"
:END:
#+TITLE: Extracting notes from Kobo Aura One
#+PROPERTY: header-args :mkdirp yes
#+PROPERTY: header-args:emacs-lisp :tangle hpi-kobo.el
#+PROPERTY: header-args:yaml :tangle roles/endpoint/tasks/hpi-kobo.yml :results none
#+CCE_PREDICATE: t
#+CCE_ANSIBLE: hpi-kobo
#+CCE_PRIORITY: 63
#+filetags: :CCE:
I use [[id:bbd4c71d-71c8-428b-919c-30be24f9c0ec][HPI]] to extract annotations fro my Kobo Aura One. It's a 7" e-reader device that supports epubs, and the Overdrive library checkout system, and the sync system is more open to sideloaded documents than Amazon's devices.
#+begin_src yaml
- name: kobuddy cloned
git:
dest: ~/Code/kobuddy
repo: https://github.com/karlicoss/kobuddy
become: yes
become_user: "{{local_account}}"
tags:
- hpi
- name: kobuddy installed to hpi venv
shell:
cmd: ~/Code/hpi/env/bin/pip install -e .
chdir: ~/Code/kobuddy/
creates: ~/Code/hpi/env/bin/kobuddy
become: yes
become_user: "{{local_account}}"
tags:
- hpi
#+end_src
#+begin_src emacs-lisp :tangle no
(pyvenv-activate "~/Code/hpi/env/")
#+end_src
#+begin_src shell
mkdir -p ~/sync/kobo/
kobuddy backup ~/sync/kobo/
#+end_src
#+begin_src python :results raw
import my.kobo as kobo
res = ""
for bwh in kobo.get_books_with_highlights():
res += "* {} by {}\n".format(bwh.book.title, bwh.book.author)
for hl in bwh.highlights:
res += "** {}\n".format(hl.text)
return res
#+end_src
#+results: