MyNixOS website logo
Description

Library for parsing epub document metadata.

Library for parsing and manipulating epub document metadata. Supports epub versions 2 and 3. This library was constructed by studying the IDPF specifications for epub documents found here http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm and here http://www.idpf.org/epub/30/spec/epub30-publications.html

epub-metadata

Synopsis

Library for parsing epub document metadata (Haskell)

Description

Library for parsing and manipulating epub document metadata. Supports epub versions 2 and 3.

This library was constructed by studying the IDPF specifications for epub documents found here for version 2.0.1 and here for version 3.0

Why was this done?

The motivation for this project grew out of my desire to take charge of missing or incorrect epub metadata in books I have purchased. I started out using the Calibre open source tools for examining this info. Limitations and incomplete implementation of those tools led me here to build a more complete library in one of the best programming languages ever created.

Why didn't I just use existing solutions?

Calibre ebook-meta utility

I experienced various problems using this software, such as:

  • Incomplete and in some cases incorrect handling of tags that can exist more than once (creator, contributor), particularly when they are differentiated using attributes according to the spec.

  • Unable to display many fields in the OPF Package Document metadata specification. Unable to manipulate data that is represented as attributes of tags in the OPF spec.

  • Astonishingly slow performance. A command-line renaming tool built with epub-metadata is more than 45 times faster at parsing and displaying epub metadata. I'm going to blame Python here for Calibre's performance. This has had a big impact on projects where I've been processing hundreds of epubs in batch operations.

epub on Hackage, epub E-Book construction support library

  • The focus of this project seems to be with building new documents, not parsing existing files. And there is a specific attempt to do more than the metadata, to gather up the content and other metafiles that make up an epub for creation.

  • Examining Codec.Ebook.OPF.Types, most of the metadata fields from the OPF Package Document spec are missing or aren't modeled thoroughly. I felt that to contribute to this project, I would have had to significantly rip up the types and redesign them.

  • At this time it seemed like a better solution for me to start fresh with modelling the types and code to manipulate them. That said, I would be very interested in combining the epub and epub-metadata projects at some point in some way that makes sense.

Using this library

Please see the Haddock documentation or source code for Codec.Epub

This file has a working example of using this library.

Getting source

  • Download the cabalized source package from Hackage
  • Get the source with git: $ git clone https://github.com/dino-/epub-metadata.git
  • Get the source with cabal-install: $ cabal get epub-metadata
  • Get the source with stack: $ stack unpack epub-metadata
  • If you're just looking, browse the source

And once you have it, building the usual way:

$ stack build
$ stack test
$ stack haddock

Generating tags

$ hasktags --ctags .

Contact

Dino Morelli )

Metadata

Version

5.2

License

Executables (1)

  • bin/epub-metadata-example

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows