Find the ePub version from epub file

Is there any way I could find out if a EPUB book is version 2.0 (2007), 3.0 (2011) or 3.1 (2015)?

djviking@box:~/Books> file -b Packt\ Publishing\ -\ Java\ 9\ High\ Performance\ \(2017\).epub  
Microsoft OOXML

Not sure why it identifies the EPUB as OOXML.

Okular > Properties
MIME: application/epub+zip (application/epub+zip)

I am also using Calibre, but cannot find this information there either.
Opening the EPUB in Calibre Editor I can find the following:


<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">

Which might indicate that it is EPUB 2.0 ?
Though this URL does not exist. Perhaps this is why my Kobo Aura ONE have problem displaying their text.

I have two older books from the same publishers (which display fine) and in edit mode, the files within are not xhtml, but html and seems to be using DocBook.


<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Using dataflow variables for lazy evaluation</title><link rel="stylesheet" href="epub.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"/></head>

These older books are identified as EPUB using the file command

djviking@box:~/Books> file -b Packt\ Publishing\ -\ Groovy\ 2\ Cookbook\ \(2013\).epub  
EPUB document

Edit: I think I found a program that gives me the EPUB version of the file.


djviking@box:~/Books> epubcheck Packt\ Publishing\ -\ Groovy\ 2\ Cookbook\ \(2013\).epub  
Validating using EPUB version 2.0.1 rules.
No errors or warnings detected.
epubcheck completed
djviking@box:~/Books> epubcheck Packt\ Publishing\ -\ Mastering\ Java\ 9\ \(2017\).epub  
Validating using EPUB version 3.0.1 rules.
No errors or warnings detected.
epubcheck completed

Found this on the web (@http://support.mantano.com/customer/portal/articles/976883-how-to-know-if-my-epub-is-in-epub-3-format-)

If you want to know if your epub is an EPUB 2 or an EPUB 3, you can use the following instructions:

  • Unzip the Epub file
  • Open META-INF/container.xml
  • Search for the XML node «rootfile» and take note of the full-path.
    Example :
    <rootfile full-path=“OEBPS/content.opf” media-type=“application/oebps-package+xml”/>

In the file indicated by this html tag (OEBPS/content.opf) look how begins the file:

  • Epub2: <package xmlns=“OPF Namespace” unique-identifier=“ean” version=“2.0”>
  • Epub3: <package xmlns=“OPF Namespace” unique-identifier=“ean” version=“3.0”>