Skip to content

gildo/talpa

Repository files navigation

talpa

A personal tool to extract reading data from Kobo and Kindle e-readers and explore it with Datasette dashboards.

I built this because I wanted to see my reading habits over time (hours per book, daily patterns, vocabulary lookups) without relying on any cloud service. It grabs everything from the devices over USB, dumps it into SQLite, and serves it locally. Nothing fancy.

Screenshot From 2026-02-23 17-26-55 Screenshot From 2026-02-23 17-27-52

Usage

# Kobo: connect via USB, then
./sync.sh

# Kindle: connect via USB, then
./kindle_sync.sh

# Launch dashboards
./serve.sh

Opens at http://localhost:8001.

Kobo

sync.sh copies the Kobo database, cleans it up (Kobo DBs are often corrupted), saves a snapshot, and installs a trigger to prevent the AnalyticsEvents table from being purged on WiFi sync.

That table is the only source of per-session reading data (seconds read, pages turned, timestamps). Kobo silently deletes it every sync. The PreserveAnalyticsEvents trigger blocks this. It survives reboots but a firmware update may reset it, so just re-run sync.sh after updating.

Warning: The trigger modifies your Kobo's database directly. sync.sh backs it up automatically before any changes, but if you want to be extra cautious, copy .kobo/KoboReader.sqlite yourself first. A firmware update may remove the trigger — just re-run sync.sh after updating. See kobo-db-tools for more background on this approach.

The device is auto-detected by partition label. To override:

KOBO_MOUNT=/path/to/kobo ./sync.sh

To remove the trigger:

sqlite3 $KOBO_MOUNT/.kobo/KoboReader.sqlite "DROP TRIGGER PreserveAnalyticsEvents;"

Kindle

kindle_sync.sh extracts reading data from multiple sources on the Kindle:

  • KRDS files (.azw3f/.yjf): binary reading stats with time per book, words read, and timestamped reading positions
  • vocab.db: every dictionary lookup with context sentence and timestamp
  • My Clippings.txt: highlights, notes, bookmarks
  • KOReader stats: per-page reading duration, if you use KOReader
  • collections.json: genre/category tags

Auto-detected by partition label. To override:

KINDLE_MOUNT=/path/to/kindle ./kindle_sync.sh

Files

sync.sh                    # Copy DB from Kobo + install trigger
kindle_sync.sh             # Extract all Kindle reading data
kindle_parse_krds.py       # KRDS binary parser -> SQL
kindle_parse_clippings.py  # My Clippings.txt parser -> SQL
serve.sh                   # Launch Datasette (via uvx, zero install)
metadata.yaml              # Dashboards, queries, table descriptions
templates/index.html       # Redirects to dashboard list
static/custom.css          # Dark theme
data/                      # (gitignored) SQLite databases + snapshots

Credits

License

MIT

About

Extract and visualize reading habits from Kindle and Kobo e-readers with local Datasette dashboards

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors