Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-19-2020, 08:25 PM   #1
rigogsilva
Enthusiast
rigogsilva doesn't litterrigogsilva doesn't litter
 
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!!!
rigogsilva is offline   Reply With Quote
Old 05-19-2020, 09:23 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: 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
kovidgoyal is online now   Reply With Quote
Old 05-19-2020, 11:46 PM   #3
rigogsilva
Enthusiast
rigogsilva doesn't litterrigogsilva doesn't litter
 
Posts: 31
Karma: 136
Join Date: May 2020
Location: US
Device: kobo libra h20, kobo aura h20, kindle, boox nova 2
Quote:
Originally Posted by kovidgoyal View Post
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
Ok, so I have calibre installed. I also created the __init__.py. When I run the command “ calibre-customize -b .” it fails. Do I need to copy the calibre-customize from the applications folder into my plugin folder?

My folder structure is:
/rigo/calibre-plugin
/__init__.py
rigogsilva is offline   Reply With Quote
Old 05-20-2020, 12:02 AM   #4
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: 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
kovidgoyal is online now   Reply With Quote
Old 05-20-2020, 12:04 AM   #5
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: 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
kovidgoyal is online now   Reply With Quote
Old 05-20-2020, 01:12 PM   #6
rigogsilva
Enthusiast
rigogsilva doesn't litterrigogsilva doesn't litter
 
Posts: 31
Karma: 136
Join Date: May 2020
Location: US
Device: kobo libra h20, kobo aura h20, kindle, boox nova 2
Quote:
Originally Posted by kovidgoyal View Post
fails with what error and a plugin is a directory containing __init__.py and a txt file with the plugins import name

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.
rigogsilva is offline   Reply With Quote
Old 05-20-2020, 08:13 PM   #7
rigogsilva
Enthusiast
rigogsilva doesn't litterrigogsilva doesn't litter
 
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?
rigogsilva is offline   Reply With Quote
Old 05-20-2020, 10:04 PM   #8
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: 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.
kovidgoyal is online now   Reply With Quote
Reply

Tags
calibre, plugin, python3


Forum Jump

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


All times are GMT -4. The time now is 07:48 AM.


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