Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 08-27-2009, 02:06 PM   #1
macuser15905
Junior Member
macuser15905 began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Aug 2009
Device: none
Developing a plugin on osx 10.5

Hi, this is a beginner question regarding python development on osx using application bundles.

I would like to create a calibre plugin that automatically locates the ISBN from each book in my library and pulls the book metadata from the internet: title, author, publisher, date.

I have looked at the plug-in documentation, and I have a basic understanding of python. However, I'm unsure how to reference the calibre python module from within the application bundle.

Does anyone have an example of how to do this?
macuser15905 is offline   Reply With Quote
Old 08-27-2009, 02:55 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,125
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You wont be able to create a plugin to automatically fetch the metadata. But you can just create a new metadata reader plugin for your files that extracts the ISBN. That way you can just click a button and calibre will download all metadata based on the extracted plugin.

As for your question: Look in the calibre sources (in the builtins module) to see how metadata reader plugins are created. Create yours in exactly the same way and add it to calibre with a high priority so it overrides the built-in one.
kovidgoyal is offline   Reply With Quote
 
Enthusiast
Old 08-28-2009, 03:54 PM   #3
macr0t0r
Connoisseur
macr0t0r doesn't littermacr0t0r doesn't litter
 
macr0t0r's Avatar
 
Posts: 91
Karma: 108
Join Date: Jan 2008
Device: Palm Treo 680, Sony Reader
If I understand correctly, you want to update the Meta-Data for all of the books that are already in your library, correct?

Looks like you'll want to use Calibre's command-line tools and create a standalone script.
http://calibre.kovidgoyal.net/user_m...cli-index.html

Let's see, to get a list of your books (you'll need the database IDs for each one):
calibredb list

Then you need to get the current metadata so that you can get the ISBN number:
calibredb show_metadata [options] id

Then you'll want to use that ISBN to search for Metadata:
fetch-ebook-metadata --isbn ########

And then you take that new data and apply it to each eBook in the database by id:
calibredb set_metadata id /path/to/metadata.opf

Anyhow, I leave the details to you on how you want to script it. You could do it in Applescript if you want. Let us know how far you get!

- Jim
macr0t0r is offline   Reply With Quote
Reply

Tags
bundle, module, osx, python

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Plugin Type Idea: Library Plugin cgranade Plugins 3 09-15-2010 12:11 PM
Developing for the iPad? phmadore General Discussions 7 04-09-2010 05:48 PM
Difference between emulator and real device (developing uds plugin for djvu) luite iRex 7 03-03-2010 08:55 PM
I need help for developing Smellyday Kindle Developer's Corner 1 11-28-2009 11:12 AM
iLiad Developing Apps Open Window iRex Developer's Corner 10 02-13-2007 11:49 AM


All times are GMT -4. The time now is 08:42 PM.


MobileRead.com is a privately owned, operated and funded community.