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 ;-).
- The script needs access to both databases, typically
metadata.db
for calibre, andapp.db
for calibre-web, update the paths tocalibre_db
andcalibre_web_db
inrun.py
. - Install pandas:
pip3 install pandas
. - Run the script, optionally add logging with
--log
- 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 toSettings > Users > <your user>
.)