Skip to main content
# -*- org-confirm-babel-evaluate: nil; -*-

#+begin_src python :exports results :results drawer :dir src
import kobuddy
return kobuddy.__doc__
#+end_src

#+RESULTS:
:results:

Kobuddy is a tool to backup Kobo Reader sqlite database and extract useful things from it.

It gives you access to books, annotations, progress events and more!

Tested on Kobo Aura One, however database format should be mostly the same on other Kobo devices.
I'll happily accept PRs if you find any issues or want to help with reverse engineering more events.
:end:

* Installing
From pypi: ~pip3 install --user kobuddy~

You can also use without installing by running =./kobuddy=.

* Usage

#+begin_src bash :exports both :results scalar
kobuddy --help
#+end_src

#+RESULTS:
#+begin_example
usage: kobuddy [-h] [--db DB] [--errors {throw,return}] {books,progress,annotations,backup} ...

Library to parse and provide Python interface for your Kobo reader

positional arguments:
{books,progress,annotations,backup}
books print all books
progress print all book reading progress
annotations print all annotations (bookmarks/highlights/comments)
backup backup the database from your Kobo device

optional arguments:
-h, --help show this help message and exit
--db DB
By default will try to read the database from your Kobo device.
If you pass a directory, will try to use all Kobo databases it can find.

--errors {throw,return}
throw: raise on errors immediately; return: handle defensively long as possible and reasonable
#+end_example

** as a standalone app
Example of printing reading progress:

#+begin_src bash :exports source
kobuddy --db /L/backups/kobo progress
#+end_src

#+begin_example
Perihelion Summer by Greg Egan
Started : 27 Jul 2019 14:39
Finished: 05 Oct 2019 14:00
-- 27 Jul 2019 14:39: reading
-- 04 Aug 2019 16:40: highlight
-- 27 Aug 2019 12:33: reading: 25%
-- 02 Oct 2019 17:33: reading: 39%, read for 7 mins
-- 02 Oct 2019 17:42: reading: 46%, read for 8 mins
-- 02 Oct 2019 17:46: reading: 48%, read for 3 mins
-- 02 Oct 2019 17:48: reading: 50%
-- 02 Oct 2019 17:52: reading: 52%, read for 4 mins
-- 02 Oct 2019 21:49: reading: 75%
-- 02 Oct 2019 21:50: reading: 76%, read for 29 mins
-- 05 Oct 2019 11:56: reading: 86%, read for 14 mins
-- 05 Oct 2019 13:50: reading: 90%
-- 05 Oct 2019 14:00: reading: 100%, read for 19 mins
-- 05 Oct 2019 14:00: finished, total time spent 200 mins
#+end_example

** as a backup tool
#+begin_src bash :exports both :results scalar
kobuddy backup --help
#+end_src

#+RESULTS:
#+begin_example
usage: kobuddy backup [-h] [--label LABEL] path

You can run it via cron, for example every minute. When you connect your device via USB, the database will be backed up.

: * * * * * kobuddy backup /path/to/backups/kobo/

Alternatively, you can add a udev rule or something similar.

positional arguments:
path target directory or file to dump the database

optional arguments:
-h, --help show this help message and exit
--label LABEL device label (check lsblk if default doesn't work)
#+end_example

** as a library

#+begin_src python :exports both :results value scalar :dir src
import kobuddy
kobuddy.set_databases('/L/backups/kobo/')
return kobuddy.get_books()[8: 10]

#+end_src

#+RESULTS:
: [Blindsight by Peter Watts, Classical Mechanics by John C. Baez & Derek K. Wise]


You can also find [[https://github.com/karlicoss/orger/blob/master/modules/kobo2org.py][some]] [[https://github.com/karlicoss/orger/blob/master/modules/kobo.py][examples]] in Orger or [[https://github.com/karlicoss/my/blob/master/my/books/kobo.py][my]] package.

If you are looking for some specific Kobo events, check out ~EventTbl~ class, there is a good chance it's been reverse engineered.


* Related projects/services
- [[https://github.com/pettarin/export-kobo][export-kobo]]: only processes annotations from a single database
- [[https://www.thekobonotes.com]]: closed source; you have to upload database manually, however it does display them as a nice html

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kobuddy-0.6.20260724.tar.gz (913.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kobuddy-0.6.20260724-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file kobuddy-0.6.20260724.tar.gz.

File metadata

  • Download URL: kobuddy-0.6.20260724.tar.gz
  • Upload date:
  • Size: 913.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for kobuddy-0.6.20260724.tar.gz
Algorithm Hash digest
SHA256 9bc1d77d0ffc5238356e9deca66878580502be53049edb5d0a8a8133b1285a9e
MD5 bb63884d2db0fb42143cb9a134da77c3
BLAKE2b-256 74aea23a751bbdee5f52e6aaf6ff3f38931e3a09693a5d8171b8600650c7e825

See more details on using hashes here.

File details

Details for the file kobuddy-0.6.20260724-py3-none-any.whl.

File metadata

  • Download URL: kobuddy-0.6.20260724-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for kobuddy-0.6.20260724-py3-none-any.whl
Algorithm Hash digest
SHA256 136ebd097c7c5b1cec3387c8df026123762194a62d714c8c9c3b64ad1a68daf5
MD5 33d8baa97ee6faac4da9b73cd19f691d
BLAKE2b-256 43a66be64aa1a978d66ef64f031aefa42d7a49e82bbedbb5e5c5d132207d9ffb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page