Skip to content

supfors/c2cw_shelf_sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

run.py

This script attempts to create calibre-web shelves for each tag in the calibre database and then associate books based on their respective tags and links in calibre. I'm using it so my tags show up as collections on my Kobo E-reader. This script was primarily a learning experience with pandas, use at your own risk ;-).

Getting started

⚠️ Make sure you have a back-up of your calibre-web database before you start.

  • The script needs access to both databases, typically metadata.db for calibre, and app.db for calibre-web, update the paths to calibre_db and calibre_web_db in run.py.
  • Install pandas: pip3 install pandas.
  • Run the script, optionally add logging with --log

Notes

  • The script does not touch shelves for which no corresponding tag(name) is found in the calibre database.
  • The script removes books from a shelf when you remove a tag from a book in calibre. (Previous note also applies here)
  • The first calibre-web login after the initial sync may take some time.
  • The shelves are assigned to the user with user_id 1. Locate calibre_web_user_id in the script and modify it according to your user ID. (Your user ID can also be found in the URL when you navigate to Settings > Users > <your user>.)