Skip to main content

Description

With this script you can get the highlights from Kobo reader using the sqlite file. The reason I made it is because when you export the highlights, a basic information as the page where are located is not exported. Oh, thanks, Kobo, for this useless option. When I highlight something usually I want to reference in other place, so maybe I need to search in the original content to expand the context.

Basic Usage

To run the basic usage, you just need to clone this repo and follow the next steps:

  1. Export the KoboReader.sqlite file from your Kobo and place it in the root path where this code has been downloaded.
  2. Run pip install . or pip install --upgrade .
  3. Run python app.py

All the highlights will be extracted and saved in an .md file with the name of the book, into a highlights folder, and with the follow structure:

# Title

## Chapter 1

Lorem Ipsum

Progress: Position progress on chapter
Date: date when the highlight was highlighted

---

Lorem Ipsum2

Progress: Position progress on chapter
Date: date when the highlight was highlighted

## Chapter B

Lorem Ipsum

Note: A note 

Progress: Position progress on chapter
Date: date when the highlight was highlighted

...

Advanced usage

This script accepts some parameters to use in a more advanced usage:

  • --db-file: if your .sqlite file has another name, you can specify it with this param
  • --template: if you want to use another template, you can pass it using this param. Please, use the template at the end as example to know what variables you can use.
  • --highlights-path: if you want to put the exported highlights in another place, you can specify it with this param.

Basic template

# {{ book_data['book_title'] }}

{% for chapter in book_data['chapters'] %}

## {{ chapter['chapter_title'] }}

{% for highlight in chapter['highlights'] %}

> {{ highlight['highlight'].strip() }}

{% if highlight['note'] is not none and highlight['note'] != "" %}
Note: {{ highlight['note'] }}
{% endif %}

Progress: {{ highlight['chapter_progress'] }} %
Date: {{ highlight['date'] }}

---

{% endfor %}
{% endfor %}

Metadata

Release files for kobo-highlights-extractor 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kobo-highlights-extractor 0.1.0
File Size Uploaded
kobo_highlights_extractor-0.1.0.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kobo-highlights-extractor 0.1.0
File Interpreter ABI Platform
kobo_highlights_extractor-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.9 kB

Release files / kobo_highlights_extractor-0.1.0.tar.gz

Download URL kobo_highlights_extractor-0.1.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c878c479b5112b96d353c908928bb44eaca93deb1426776321ceaed6189368fa
BLAKE2b-256 checksum
How to use checksums
249e5978a46b4149d3ae20157540163dfe99bd966a103f067c36d2e23b550978
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.9

Release files / kobo_highlights_extractor-0.1.0-py3-none-any.whl

Download URL kobo_highlights_extractor-0.1.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7ade53b5174342eb9c70201dfd5228bebcdc69691b0583f4677cb8c28efdf66
BLAKE2b-256 checksum
How to use checksums
814abffda329c4a1c700e87bb23778183cce9180dd357bb04685b886ca37eddf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page