Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 08-06-2019, 06:50 AM   #1
dalanicolai
Junior Member
dalanicolai began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Aug 2019
Device: PocketBook Touch Lux 3
Get filepath with bash or python

Hi everyone,

Excuse me for posting this seemingly very simple question, but I've already spent quite some time now to find out how to obtain the filepath of a book using either the caliber CLI or the database API.

I would like to use the calibre database to quicklaunch a book with ulauncher without opening the full calibre gui. For this I would like to implement the functionality in the "Tracker recoll docfetcher locate search" plugin.

Anybody knows a quick way to obtain the filepath using calibre tools?

(unfortunately I am only a hobbyist trying to learn python but understanding the calibre design is still quite overwhelming)

Thanks!
dalanicolai is offline   Reply With Quote
Old 08-06-2019, 07:37 AM   #2
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 14,411
Karma: 12542140
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Have a look at the calibrespy plugin, you'll find what I think you're looking for in calibrespy_dialog.py at about line 1965

BR
BetterRed is offline   Reply With Quote
Advert
Old 08-06-2019, 08:42 AM   #3
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: 34,926
Karma: 12669638
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibredb list -f formats --for-machine

or using a python API, assuming you already have a db object

Code:
db.new_api.format_files(book_id)
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Python 2 to Python 3, Polyglot & Plugins DaltonST Calibre 18 04-24-2019 12:10 AM
FBReader update: hash vs filepath difficulties. taratears Android Devices 0 04-29-2017 05:00 PM
bash error iomari Calibre 2 08-19-2013 01:40 PM
Tell which kindle model from a filepath? stepk Kindle Developer's Corner 17 05-15-2013 08:54 AM
An available bash 4.2 for KT silverzhao Kindle Developer's Corner 2 02-06-2013 10:37 AM


All times are GMT -4. The time now is 02:59 AM.


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