Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-24-2018, 08:52 PM   #1
modnar_wylde
Junior Member
modnar_wylde began at the beginning.
 
Posts: 4
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, 09:20 PM   #2
jackie_w
Grand Sorcerer
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: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
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
Old 11-24-2018, 10: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: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
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 offline   Reply With Quote
Old 11-25-2018, 07:52 PM   #4
modnar_wylde
Junior Member
modnar_wylde began at the beginning.
 
Posts: 4
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, 08: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: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
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 offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 05:34 PM.


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