05-19-2020, 08:25 PM | #1 |
Enthusiast
Posts: 31
Karma: 136
Join Date: May 2020
Location: US
Device: kobo libra h20, kobo aura h20, kindle, boox nova 2
|
Developing plugins (python3)
I have been looking at the docs on how to build a calibre plugin, but can't find I can't find some detail information.
Do I need to install the whole calibre library? Is there a pip install calibre library? Newby here so, need some more details if anyone can help. Also, I am trying to this in python3. R.I.P 2.7. Thank you!!! |
05-19-2020, 09:23 PM | #2 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You dont need to install anything other than calibre itself. If you want to use python 3 then install the calibre python 3 betas from https://www.mobileread.com/forums/sh...d.php?t=325721
And see https://manual.calibre-ebook.com/creating_plugins.html |
05-19-2020, 11:46 PM | #3 | |
Enthusiast
Posts: 31
Karma: 136
Join Date: May 2020
Location: US
Device: kobo libra h20, kobo aura h20, kindle, boox nova 2
|
Quote:
My folder structure is: /rigo/calibre-plugin /__init__.py |
|
05-20-2020, 12:02 AM | #4 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
fails with what error and a plugin is a directory containing __init__.py and a txt file with the plugins import name
|
05-20-2020, 12:04 AM | #5 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you are on macOS, then read the note: https://manual.calibre-ebook.com/gen...cli-index.html
|
05-20-2020, 01:12 PM | #6 | |
Enthusiast
Posts: 31
Karma: 136
Join Date: May 2020
Location: US
Device: kobo libra h20, kobo aura h20, kindle, boox nova 2
|
Quote:
rigo$ calibre-customize -b . bash: calibre-customize: command not found It can’t access that command. That is why I asked, I needed to move the `calibre-customize` file into the folder where the init file is. Also, when trying to import calibre in the __init__.py file, it doesn’t really recognize calibre because that wan’t installed as a python library and the folder that has the init file doesn’t really have that `calibre` module. So may be missing something. Last edited by rigogsilva; 05-20-2020 at 01:15 PM. |
|
05-20-2020, 08:13 PM | #7 |
Enthusiast
Posts: 31
Karma: 136
Join Date: May 2020
Location: US
Device: kobo libra h20, kobo aura h20, kindle, boox nova 2
|
the good news is that I can apply the plugin by using the absolute path: "/Applications/calibre.app/Contents/MacOS/calibre-customize -b ." in my directory. That works fine and applies the plugin.
The other issue I am having is when developing the library. My text editor doesn't know that calibre exists so when I write: from calibre.customize import FileTypePlugin" I don't get any library hints. Do I need to `pip` install a calibre library to get those hints?
|
05-20-2020, 10:04 PM | #8 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Depends on how your editor does hinting. You cannot install calibre as library, but you can add the PATh to the calibre source code to PYTHONPATH.
|
Tags |
calibre, plugin, python3 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problems running Python3.4/GObject (GTK3.0) | katadelos | Kindle Developer's Corner | 3 | 11-21-2019 01:18 PM |
python3 plugins? | Claghorn | Plugins | 4 | 11-12-2019 07:57 PM |
Aura How to install python3 in Kobo Aura? | guchai25 | Kobo Reader | 0 | 11-12-2019 09:41 AM |
Python3 on Aura One | Kristoffer_1 | Kobo Developer's Corner | 5 | 07-06-2019 06:20 PM |
"Remove the dependency on the zip command line tool when developing plugins"? | JimmXinu | Plugins | 2 | 07-13-2012 02:09 PM |