View Single Post
Old 01-22-2023, 06:22 AM   #3
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Depending on what you want to do book-by-book, the API db.cache.(add_custom_book_data(), get_custom_book_data(), delete_custom_book_data(), and get_ids_for_custom_book_data()) might do the job. These let you store and retrieve more-or-less arbitrary data on a book-by-book basis. Internally calibre uses a table with three columns (book_id, data_name, data_val), where data_val is the json representation of the data.

You could store a python dict of your key:value pairs.

If needed, you could give users access to the data via Python stored templates. The template would load the dict and return the desired value(s).
chaley is offline   Reply With Quote