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.
# Kobo: connect via USB, then
./sync.sh
# Kindle: connect via USB, then
./kindle_sync.sh
# Launch dashboards
./serve.shOpens at http://localhost:8001.
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.shbacks it up automatically before any changes, but if you want to be extra cautious, copy.kobo/KoboReader.sqliteyourself first. A firmware update may remove the trigger — just re-runsync.shafter 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.shTo remove the trigger:
sqlite3 $KOBO_MOUNT/.kobo/KoboReader.sqlite "DROP TRIGGER PreserveAnalyticsEvents;"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.shsync.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
- kobo-db-tools for the trigger approach to preserve AnalyticsEvents
- KRDS for parsing the Kindle binary format
- Datasette + datasette-dashboards
MIT