DEV Community

Andrey Korchak
Andrey Korchak

Posted on

How do I collect all of my notes and highlights from iBooks? πŸ“š 🍏 ibooks-notes-exporter! πŸ––

People remember less than 20% of what they read if they are not taking notes. That's why it's always a good idea to take notes while you are reading.

I'm always highlighting key ideas while reading. I use standard iBooks features for that and it works just fine for me. But problems come after, when I have to memorize things I've just read β€” there is no way to extract all my highlights and notes from iBooks! I need to convert all my records into Notion page or Anki cards, but I can't! The best thing you can do with your notes is to manually copy and paste them to another text editor, one by one.

So I dived into iBooks internals and found that it stores all data in SQLite files which can be processed by 3rd party software. Hence, we can hack through this problem and write a little exporting tool for iBooks! πŸ€“

My primary programming language is Python, but I decided to use Go. Two main reasons for that β€” I was planning to learn Go for almost three years (and never had time for it), and binary files are easier to distribute via Homebrew.

So last week I spent a couple of days coding and created ibooks-notes-exporter. This is a little command line tool that takes all your records from iBooks and exports them into Markdown files. I made that tool open source, code is published on GitHub. Your feedback and pull requests are much appreciated πŸ™

Installation

ibooks-notes-exporter is available on OS X (both Intel and M-series processors). It's distributed via a homebrew package manager.

Run these commands in your terminal


> brew tap 57uff3r/mac-apps
> brew install 57uff3r/mac-apps/ibooks_notes_exporter

Enter fullscreen mode Exit fullscreen mode

Usage

First of all, you have to get a list of all your books with notes and highlights.

❯ ibooks_notes_exporter books
+----------------------------------+-----------------+----------------------------------------------------------------------------------+
| SINGLEBOOK ID                    | NUMBER OF NOTES | TITLE AND AUTHOR                                                                 |
+----------------------------------+-----------------+----------------------------------------------------------------------------------+
| 4BAE5DA3C95788753173EAE8C63E6034 |               1 | Lorem impsum β€” John Doe                                                          |
| 7C3FA4F94689D97444BB4E0FD97D7197 |              54 | Hamlet β€” william shakespeare                                                     |
+----------------------------------+-----------------+----------------------------------------------------------------------------------+
Enter fullscreen mode Exit fullscreen mode

And then you can export all your notes from the book into a markdown file.

❯ ibooks_notes_exporter export 4BAE5DA3C95788753173EAE8C63E6034 > ./LoremImpsum.md
Enter fullscreen mode Exit fullscreen mode

Please note you have to use the book ID from the previous command.

Top comments (0)