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 11-24-2018, 09:52 PM   #1
modnar_wylde
Junior Member
modnar_wylde began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Nov 2018
Device: none
How to write a Metadata plugin

I'm looking for some guidance.

I want to see how to write a plug-in to gather metadata from
onebookshelf & DMsGuild for identifying and collecting metadata from there.
modnar_wylde is offline   Reply With Quote
Old 11-24-2018, 10:20 PM   #2
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 4,646
Karma: 11226921
Join Date: Sep 2009
Location: UK
Device: Sony:PRS-350, Kobo:Aura6"/H2O/GloHD/KA1/ClaraHD/Forma
Maybe have a look at the code in some of the existing plugins in the Metadata Source section of the Index of calibre plugins sticky thread.
jackie_w is offline   Reply With Quote
Advert
Old 11-24-2018, 11:33 PM   #3
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 15,687
Karma: 25902256
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo,Aura H2O,Glo HD,Aura ONE,Clara HD,Forma;tolino epos
That's the simplest thing to do. There are plenty of examples you can look at. I don't know which is the best to look at as they all do things a little differently. You should also look in the calibre source at src/calibre/ebooks/metadata/sources/base.py. You can see the API and what needs to be overridden.

And having a quick look at the two sites mentioned, onebookshelf.com seems to be parent site for a group of others. And they look like they probably use the same source code for all the sites. And it is likely they have an API. If so, the results from that are usually easier to handle than parsing a web page.
davidfor is online now   Reply With Quote
Old 11-25-2018, 08:52 PM   #4
modnar_wylde
Junior Member
modnar_wylde began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Nov 2018
Device: none
I think I have functional rewrite, but it how do you generate a usable/testable plugin?

and yes, they (OBS) is a single code build, with various skins for their properties, I'm working from the belief they all should respond similarly.

I just need to test the code in an enviroment to troubleshoot responses.
modnar_wylde is offline   Reply With Quote
Old 11-25-2018, 09:38 PM   #5
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 15,687
Karma: 25902256
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo,Aura H2O,Glo HD,Aura ONE,Clara HD,Forma;tolino epos
You just need create the zip file and install it. The latter can be done from the Plugins page of the preferences. But, I use small script file to build, install and restart calibre when testing. They look like:


Code:
del "..\Annotations.zip"
"c:\Program Files\7-Zip\7z.exe" a "..\Annotations.zip" *.py developer_notes.txt dialogs\* help\* images\*.png plugin-import-name-annotations.txt readers\*.py -x!readers\_* README.md about.txt run.cmd translations/*.po translations/*.mo
mode 165,999
calibre-customize -a "..\Annotations.zip"
SET CALIBRE_DEVELOP_FROM=E:\Development\GitHub\calibre\src
calibre-debug  -s
calibre-debug  -g
That isn't for a metadata source plugin, but the overall concept is the same. The "SET" statement is for running from calibre source. You probably don't need to do this.

Once calibre is started, just test the metadata download and look at the log produced for errors. I tend to put a lot of logging statements in so that I can see what is happening.

You can test the identify method without the GUI, but, I don't usually do it that way.
davidfor is online now   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Metadata Writer Plugin] Embed Comic Metadata dickloraine Plugins 93 08-05-2018 07:01 PM
Regarding using metadata objects in identify method of metadata download plugin api aprekates Development 1 07-06-2014 04:35 AM
Duplicate book over write of metadata Mel Mills Calibre 0 12-14-2012 02:09 AM
[Metadata Download Plugin] Goodreads Metadata **Deprecated** kiwidude Plugins 30 04-23-2011 03:10 PM
Write MetaData changes to book files tbergman Calibre 3 01-03-2011 07:02 PM


All times are GMT -4. The time now is 08:36 AM.


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