Hi everyone, thanks for your great work developing Joplin. I created a Python script that imports highlights and annotations from a Kindle eReader device into Joplin. Please feel free to test it and/or improve it.
It creates a notebook in Joplin and individual notes for each book inside that notebook. All the highlights and annotations for each book are stored in the same note and separated by a horizontal line. When a note for a book already exists, this script updates the note with the new highlights.
Requirements
- python 3.7+
- httpx
- pandas
- dateparser
- joplin_api
Download this package
git clone https://gitlab.com/seawind/kindle-highlights-in-joplin.git
Getting your kindle highlights and annotations in Joplin
- Access the folder
kindle-highlights-in-joplin
. - Open the file
conf.py
and enter your Koplin Token.
- To find your Joplin Token, open Joplin and access to Tools -> Options -> Web Clipper. Enable the web clipper service and copy your authorisation token in the
token
variable in theconf.py
file.
- Define a name for the notebook in Joplin in which you want to store your highlights.
- Connect your Kindle device and find the path to the file where your highlights and notes are stored. It is usually inside the folder
Documents
. The name of the file depends on the language in your device. In English it isMy Clippings.txt
, or in SpanishMis recortes.txt
. - Copy the path in the variable
path_highlights
in the fileconf.py
The file conf.py
looks like this:
token = 'your_token'
folder = 'Kindle highlights'
path_highlights = '/path/to/your/Kindle/My Clippings.txt'
- Open a terminal in the
kindle-highlights-in-joplin
folder and run the next command:
python sync_kindle_joplin.py
Considerations
-
This script has been tested with the highlights stored in a Kindle D01100. It might be different for other models.
-
Kindle eReaders usually store the highlights and notes in a txt file. The name of the file depends on the language in which the device is configured.
-
The elements stored in that file follow a specific structure, a specific sequence of characters separates individual highlights. The metadata for each highlight is written in the language of the device. This package uses regular expressions to retrieve the metadata to build a unique identifier for each highlight. So far, it includes keywords in Spanish and English to identify the relevant data. You can add keywords for a different language in the
kindle_conf
module.
This script is based on the great work of @foxmask who created the joplin-api
for Python.