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"}
]
endDependencies
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)"
}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
Using internal tool for reading MOBI metadata
Support for different files in EPUB
At this moment we only support
content.opfas the main file for extracting metadata. We need to change it and scan theMETA-INFdirectory and look for thecontainertag (probably insideMETA-INF/container.xml)Using internal tool for reading PDF metadata
Improve Docs