A self-hosted custom sync server for kobo devices.
README.md

Kobo Shelf Upload — Calibre plugin #

Sends selected books from Calibre to a kobo-shelf server with one click. It authenticates with an API token (no password), and embeds Calibre's curated metadata — title, authors, series, tags, description, and cover — into the uploaded EPUB so kobo-shelf keeps it. Your Calibre library files are never modified.

Build #

uv run build.py       # produces kobo-shelf-upload.zip

(Needs uv; the script is stdlib-only, so no dependencies are installed. The zip is just the .py files plus the plugin-import-name-kobo_shelf.txt marker at its root.)

Install #

  1. Calibre → Preferences → Plugins → Load plugin from file → pick kobo-shelf-upload.zip.
  2. Restart Calibre if prompted. A Send to kobo-shelf button appears on the main toolbar. (If it doesn't, add it via Preferences → Toolbars & menus → The main toolbar.)

Configure #

  1. In kobo-shelf's web UI, create an API token (the Tokens section — the same tokens used for Kobo devices).
  2. Calibre → Preferences → Plugins → Kobo Shelf Upload → Customize plugin.
  3. Enter your server URL (e.g. https://books.example.com) and paste the token.

Use #

Select one or more books, click Send to kobo-shelf. A progress dialog runs the upload; when finished it reports how many were uploaded, skipped, or failed.

  • Skipped means the book is already on the server (kobo-shelf dedupes by content). So "select everything → Send to kobo-shelf" is a safe way to sync only what's new.
  • Only EPUB (or KEPUB) formats are sent. Books without one are listed as skipped-for-no-format in the summary details.

How it works #

For each selected book the plugin:

  1. Reads the EPUB from Calibre and embeds the current Calibre metadata into an in-memory copy (calibre.ebooks.metadata.meta.set_metadata).
  2. POSTs it as multipart/form-data to <server>/api/upload with an Authorization: Bearer <token> header.

kobo-shelf resolves that token via its existing auth_tokens table (shared with Kobo device auth) and stores the book as an upload owned by the token's user. 409 Conflict from the server means "already uploaded" and is reported as a skip.

Requirements #

  • Calibre 6.0+ (Qt6).
  • A kobo-shelf instance reachable over HTTP(S) with token upload support.