ExEbook

Metadata extracter for digital books (EPUB, MOBI, PDF)

Installation

If available in Hex, the package can be installed by adding ex_ebook to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_ebook, "~> 0.1.0"}
  ]
end

Dependencies

At this moment ex_ebook needs libmobi and xpdfreader in order to extract metadata from PDF and MOBI files.

Usage

Extract everything in one step just as follows:

EPUB

iex> "~/Downloads/programming-ecto_p1_0.epub" |> Path.expand |> ExEbook.extract_metadata
%ExEbook.Metadata{
  authors: ["Darin Wilson", "Eric Meadows-Jönsson"],
  isbn: "978-1-68050-282-4",
  language: "en",
  pages: nil,
  publisher: "The Pragmatic Bookshelf, LLC (711823)",
  subject: "Pragmatic Bookshelf",
  title: "Programming Ecto (for Felipe Juarez Murillo)"
}

PDF

iex> "~/Downloads/programming-ecto_p1_0.pdf" |> Path.expand() |> ExEbook.extract_metadata
%ExEbook.Metadata{
  authors: ["Darin Wilson", "Eric Meadows-Jönsson"],
  isbn: nil,
  language: nil,
  pages: "231",
  publisher: "Pragmatic Bookshelf",
  subject: nil,
  title: "Programming Ecto"
}

MOBI

iex> "~/Downloads/programming-ecto_p1_0.mobi" |> Path.expand() |> ExEbook.extract_metadata
%ExEbook.Metadata{
  authors: ["Darin Wilson", "Eric Meadows-Jönsson"],
  isbn: nil,
  language: "en (utf8)",
  pages: nil,
  publisher: "The Pragmatic Bookshelf, LLC",
  subject: "Pragmatic Bookshelf",
  title: "Programming Ecto"
}

And that's all

TO DO's