|
|
Thread Tools | Search this Thread |
07-06-2020, 08:03 AM | #1 |
Enthusiast
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
|
[Metadata Source Plugin] Questions regarding parse select, docs and ref templates
Hi all!
Some questions regarding the metadata plugin: 1. Are there any architecture docs for metadata plugin that describes the overall functionality of worker.py in more detail? 2. Is there any similar built in functionally the resembles of the BeautifulSoup selector ("Soup.select") in the example below: Code:
Html = requests.get(URL)
Soup = BeautifulSoup(Html)
Elements = Soup.select("#main > product-grid > li:nth-child(1) > article > a")[0]
Href = Elements[0].get('href')
-- Any suggestions are welcome, thanks in advance! |
07-06-2020, 09:16 AM | #2 |
creator of calibre
Posts: 44,316
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
1. worker.py is irrelevant, all you need to do is subclass https://manual.calibre-ebook.com/plu...a.sources.base and implement identify() and download_cover() methods.
2. beautifulSoup is available in calibre. from calibre.ebooks.beautifulsoup import BeautifulSoup 3. Look at any of th eexisting metadata download plugin |
Advert | |
|
07-06-2020, 09:35 AM | #3 |
Enthusiast
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
|
Kovidgoyal, thanks for the prompt reply!
Regarding plugin template, I'd really appreciate if you could recommend some clean implementations since the plugins I've seen so far were a bit to much spaghetti :-) Btw, are there any simple step by step guides regarding develop, test and deploy? |
07-06-2020, 10:06 AM | #4 |
creator of calibre
Posts: 44,316
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Look for the builtin plugins google and google images are both fairly short and simple. As for how to develop and test, use calibre-customize to develop, see calibre-customize --help and for testing again look at the builtin plugins, near the bottom.
|
07-06-2020, 10:26 AM | #5 |
Enthusiast
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
|
|
Advert | |
|
07-06-2020, 10:30 AM | #6 |
Enthusiast
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
|
When are you supposed to use "class Worker (Thread)" (in worker.py) to implement a metadata plugin?
PS... If possible, please move this thread to the correct forum: "E-Book Software > Calibre > Plugins" Last edited by Boilerplate4U; 07-06-2020 at 10:34 AM. |
07-06-2020, 10:37 AM | #7 |
creator of calibre
Posts: 44,316
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Never. Again worker.py is irrelevant.
|
07-06-2020, 11:04 AM | #8 |
Enthusiast
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
|
Ok. I'm a bit curious as to why almost all metadata-source-plugins that I have looked at so far, utilize the following basic structure (some kind of old methodology or auto generated?)
Code:
__init__.py changelog.txt worker.py config.py Plug-import-name goodreads.txt |
07-06-2020, 11:20 AM | #9 |
Enthusiast
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
|
Just some examples: Mondourania, Goodreads, Skoob Books, Moly_hu, Adlibris, Barnes & Noble, KoboBooks ...
|
07-06-2020, 12:13 PM | #10 |
creator of calibre
Posts: 44,316
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Probably because they copy each other. You just need to implement those two methods, thats all. What other files you use is entirely up to you.
|
07-06-2020, 01:19 PM | #11 |
Enthusiast
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
|
Aha, then that riddle was resolved! :-) Thanks, have a nice day!
|
07-06-2020, 06:56 PM | #12 | |
null operator (he/him)
Posts: 20,912
Karma: 27620686
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Moderator Notice
Bp4U - IMO your thread is where it belongs, discussion of plugin development is best done here. If it had started in the Plugins sub-forum me, or one of the other mods, would have moved it here Most people think BeautifulSoup is what you rush out to buy when your town gets locked down BR |
|
07-07-2020, 02:33 AM | #13 |
Enthusiast
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
|
|
07-07-2020, 02:35 AM | #14 |
Enthusiast
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
|
FYI, found "base.py" that works a well documented template.
(calibre/src/calibre/ebooks/metadata/sources/base.py) |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Metadata Source Plugin] FictionDB | kiwidude | Plugins | 129 | 03-16-2024 11:14 PM |
[Metadata Source Plugin] BOL.com (NL) | Pr.BarnArt | Plugins | 505 | 12-14-2023 03:23 PM |
[Metadata Source Plugin] MondoUrania | Pr.BarnArt | Plugins | 38 | 01-06-2021 09:10 AM |
[Metadata Source Plugin] Pitaval.cz (cz,sk) | Miisha | Plugins | 2 | 01-01-2021 10:48 AM |
[Metadata Source Plugin] Empty Plugin? (Fake Identifier) | mneimeyer | Plugins | 3 | 11-11-2019 08:07 PM |