books indexes a local PDF/EPUB library, fetches Douban ratings by ISBN, and
mirrors the library to a reMarkable tablet. It is a single command: one run
goes from directory selection to tablet upload and prints only a summary.
books # run the flow
books --db-path # print the resolved SQLite path- Choose directories. fzf lists every directory containing PDF/EPUB files.
The directories currently included are pre-marked; Tab toggles,
Enter confirms and continues. Directories left unselected are written to
books_local_exand are not scanned. - Scan the library. New files are inserted into
books_local; ISBNs are extracted for new files only. Existing rows are not re-extracted unless the file is new. - Fetch Douban incrementally. Only ISBNs without a successful rating are
queried.
not_found/blockedresults are remembered per file and skipped on later runs; a block stops the batch. - Mirror to the tablet. The tablet is compared through
rmpp-web. Files withonrmpp = 0are uploaded into the same relative directory; missing tablet folders are created throughrmpp-sh. - Print the summary.
Example:
directories: 11 kept, 4 excluded
library: 61 file(s) — 48 ISBN, 13 no ISBN
douban: 45 rated, 3 unresolved
tablet: 61/61 present, 2 extra
If the tablet is offline the last line says so; local scanning and Douban fetching still run.
- Python 3.11+ (standard library only)
rmpp-webonPATH(orsettings.rmpp_web/$RMPP_WEB)rmpp-shonPATH(orsettings.rmpp_sh/$RMPP_SH) — only for creating tablet folderspdftotextfrom Poppler for PDF ISBN extractionfzffor the directory picker
# in a checkout of rmpp-toolkit
cargo install --path crates/rmpp-web
cargo install --path crates/rmpp-shThe command is this repository's books executable; it is on PATH through
~/.my.zshrc:
export PATH="$HOME/src/books:$PATH"The only options are --db-path (print the database path), --help and
--version.
- Library root: on the first run, if it is not configured,
booksprompts for it and stores it insettings.library_root.$BOOKS_ROOToverrides the stored value. - Database:
$BOOKS_DB,db_pathinrmpp_books.toml, or the platform default (~/Library/Application Support/rmpp_books/books.dbon macOS).books --db-pathprints the resolved path without running anything. - Tablet / tools:
settings.device_host,settings.rmpp_web,settings.rmpp_sh,settings.douban_delay.
Settings live in the settings table. To change one without a CLI:
sqlite3 "$HOME/Library/Application Support/rmpp_books/books.db" \
"UPDATE settings SET value='/path/to/library' WHERE key='library_root'"| Table | Meaning |
|---|---|
settings |
static configuration |
books_local_ex |
directory prefixes excluded from the library |
books_local |
files, primary key (filepath, filename, filesuffix); onrmpp is the mirror flag |
books_douban |
successful ratings, primary key isbn |
books_isbn_miss |
per-file ISBN/Douban state, same path key as books_local; no ISBN column |
books_isbn_miss.status:
| status | Meaning |
|---|---|
no_isbn |
file was scanned, but no ISBN was found |
pending |
ISBN exists, not fetched yet |
not_found |
Douban has no entry for that ISBN |
blocked |
Douban blocked/rate-limited |
http_* / error |
request failure |
A successful fetch deletes the miss row and adds one books_douban row.
Views: v_books (join local + rating + miss status), v_books_missing
(onrmpp = 0), v_summary.
- ISBN extraction: EPUB OPF
dc:identifierthen the first pages; PDF first 15 pages throughpdftotext; ISBN-10 converted to ISBN-13 and checksum validated. In the current library 48/61 files have an ISBN; the 13 without one are recorded asno_isbnand are not sent to Douban. - Douban has no official API. Requests use a browser User-Agent and
douban_delay(default 2s). HTML changes or blocking are recorded rather than retried endlessly. - The tablet is a mirror: paths are identical, so
onrmppis enough. A misplaced document is simply “extra on tablet”; the next upload puts the file at the correct path. - Before the one-time rebuild, the old database was copied to
~/Library/Application Support/rmpp_books/backups/books-<timestamp>.db.
MIT — not affiliated with reMarkable or Douban.