View Single Post
Old 11-05-2020, 07:25 AM   #1
sigizmund
Member
sigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheesesigizmund can extract oil from cheese
 
Posts: 24
Karma: 1088
Join Date: Dec 2009
Device: Pocketbook && Android
Question Using Calibre Python API example

Hey folks,

I am trying to understand if I can write a Python code running not as a plugin which will be manipulating Calibre without UI. Example: add book to the specified Calibre library. Obviously starting calibredb command is one option, but I'm interested if I can just `import` some libraries and manipulate database in-process. In pseudocode:

Code:
import calibre.database as db

database = db.OpenDb('/path/to/library')
database.AddBook('/path/to/book.epub')
database.Close()
Thanks!
sigizmund is offline   Reply With Quote