Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-28-2017, 02:25 PM   #1
AndyBlack
Junior Member
AndyBlack began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2017
Device: none
Get Calibre version from the command line

Hi. We have a need to know which version of Calibre is installed without actually running it. (We're using calibredb to create a new ebook from another application.) Apparently, there is a difference between versions 1, 2 and version 3 in what

calibredb add -d filename
calibredb list -f size


produces. In versions 1 and 2, the just added ID was in the next to last line. In version 3 it is the last line. We'd like to be able to know the version of Calibre being used so we can know which line to use with the calibredb list command.

Thanks.
AndyBlack is offline   Reply With Quote
Old 07-28-2017, 04:52 PM   #2
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
https://manual.calibre-ebook.com/gen...cli-index.html
Divingduck is offline   Reply With Quote
Advert
Old 07-28-2017, 05:08 PM   #3
AndyBlack
Junior Member
AndyBlack began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2017
Device: none
Thanks, but with Calibre 3.5, when I use

calibre --version

on Windows, there is nothing shown. It's silent.
AndyBlack is offline   Reply With Quote
Old 07-28-2017, 05:14 PM   #4
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
take calibredb --version

and your example is a little hint for Kovid

Edit: @Kovid,
ebook-edit, ebook-viewer, lrfviewer have the same behavior as calibre --version

Last edited by Divingduck; 07-28-2017 at 05:33 PM.
Divingduck is offline   Reply With Quote
Old 07-28-2017, 06:51 PM   #5
BetterRed
null operator (he/him)
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: 21,660
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
IIRC you can use the WMIC command to get the version number of an .exe (or .dll). It's been a long time since I used WMIC, but it should be available in all versions of Windows - the so-called 'instrumentation' features wouldn't work without it.

BR
BetterRed is offline   Reply With Quote
Advert
Old 07-29-2017, 01:19 AM   #6
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: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes, there is a reason windows is named windows. Basically, in windows programs can be either console or "window" programs. The latter are not supposed to output to stdout.
kovidgoyal is offline   Reply With Quote
Old 07-29-2017, 01:16 PM   #7
AndyBlack
Junior Member
AndyBlack began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2017
Device: none
Thanks.

I had not tried using

calibredb --version

That works on Windows, Linux, and Mac. So we're all set.
AndyBlack is offline   Reply With Quote
Old 11-13-2019, 07:59 PM   #8
democrite
Evangelist
democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.
 
Posts: 440
Karma: 77256
Join Date: Sep 2011
Device: none
Hello,

is there a quicker way to get the version number from the command-line, Python, or some other way such as reading some json value? Reporting the version from "calibre --version" takes a bit of time and I'd prefer something quicker like parsing json.
democrite is offline   Reply With Quote
Old 11-13-2019, 08:03 PM   #9
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: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre-debug -c "from calibre.constants import __version__; print(__version)"


that's the quickest you are going to get. version information is not stored in JSON, but in compiled bytecode.
kovidgoyal is offline   Reply With Quote
Old 11-14-2019, 07:40 PM   #10
democrite
Evangelist
democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.
 
Posts: 440
Karma: 77256
Join Date: Sep 2011
Device: none
Thank you. That is an improvement. I'm unsure how accurate is using "time" from the command-line. On macOS on my system, it measures as ~.05s. In my use, that is a measurable increase that will affect UI updates. As my need is only macOS, maybe I can detect version number –*I need only to know it's using the updated viewer –, by checking for some existing file that's new with 4.x. Would you consider adding major version to a main json preference file? I haven't yet tried to figure out what will be potentially quickest (using Go) though I will try soon.
democrite is offline   Reply With Quote
Old 11-14-2019, 08:45 PM   #11
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: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
On macOS you can get it from Info.plist in the app bundle.
kovidgoyal is offline   Reply With Quote
Old 11-14-2019, 09:08 PM   #12
democrite
Evangelist
democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.
 
Posts: 440
Karma: 77256
Join Date: Sep 2011
Device: none
ah yes.
democrite is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to "Install Command Line Tools" on version 2.37.1 SilverWinter Calibre 13 12-08-2015 07:45 AM
Calibre with command line ? Laurent06 Conversion 2 11-09-2014 12:37 AM
Command line—HOW? (Mac OS X version) Deep Cover Calibre 3 04-21-2013 03:49 PM
Calibre Command Line Conversion bmwr1200c Calibre 1 08-10-2011 07:04 PM
Autotagging with Calibre (command line) erion Calibre 11 08-28-2010 01:33 PM


All times are GMT -4. The time now is 03:46 AM.


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