I have found in good examples of getting a calibre.ebook.Metadata object given a bookId but so far I have only seen it in InterfaceAction plugins (they get everything they need to get to the gui.db in __init__).

I'm trying to run do the same thing (get Metadata knowing a bookid) but from a Source plugin running in cli mode (calibre-debug -r "mypluginname").

I saw that there is a show_metadata method in calibredb and that seemed promising because it's the same no-ui context but I got lost trying to find where the contextdb that command uses to access the database is created.

Could anyone point me to an example that would show how to get to the book metadata knowing the bookid when the context is a "no ui" loaded context?

Metadata source plugins do not have access to the db. For example, they can be run in the fetch-ebook-metadata standalone cli tool. What is your plugin actually trying to do?

I wrote a really long response describing what my plugin was doing and why and I was still writing when I realized that am I working "on nothing".

I know very well that having the best cover, the best description, the best tags, the most accurate information, a link to the author's page, etc.. wont make my books gain any value or make me want to read them more... yet I spend I stupidly long amount of time on exactly doing those things. I do it almost compulsively.

Time to stop working on that project, and go read a book. Thanks for you help.

I'm trying to organize my audiobook collection and I've been using Calibre to get all the meta data details of the books then using a python script to clean up all the audio-file tags using the Calibre gleaned meta data.

I've added a few extra fields in Calibre (narrator, duration, number of files, uuid, audiobook reported date, etc) and the Import List plugin to create empty books for each audiobook directory and any meta data I can scrape from the audio file tags.

My original plan was to use the Calibre Content server then do a search on the UUID I create for each audiobook, but I have no idea how to scrape dynamic content produced by the Content Server (that's some seriously scrape resistant javascript).

For now, I'm exporting a CSV catalog file of the Calibre metadata then using that file to get the audiobook details during audio-file tagging.

Having a RESTful interface to get the specific Calibre book content given the UUID would be a nice thing to have.

Another nice plugin would be a way to programmatically add empty books into Calibre (for later Calibre clean up/look up).

And the calibre server has a JSON API that allows you to get pretty much any data nad perform pretty much any operation you like on a calibre server (this is the api that calibredb uses to conenct to calibre servers).