QiwiTrails.EpubMetadataReader 2.0.0

dotnet add package QiwiTrails.EpubMetadataReader --version 2.0.0
                    
NuGet\Install-Package QiwiTrails.EpubMetadataReader -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="QiwiTrails.EpubMetadataReader" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="QiwiTrails.EpubMetadataReader" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="QiwiTrails.EpubMetadataReader" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add QiwiTrails.EpubMetadataReader --version 2.0.0
                    
#r "nuget: QiwiTrails.EpubMetadataReader, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package QiwiTrails.EpubMetadataReader@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=QiwiTrails.EpubMetadataReader&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=QiwiTrails.EpubMetadataReader&version=2.0.0
                    
Install as a Cake Tool

EpubMetadataReader

A .NET Standard 2.0 library for reading metadata from EPUB files. EpubMetadataReader parses Open Publication Format (OPF) files contained within an EPUB and exposes all metadata, manifest, spine, and guide information through a simple API. Supports EPUB 2.0 and 3.0.


Installation

Install via NuGet:

dotnet add package QiwiTrails.EpubMetadataReader

Usage

Load from a file path

using EpubMetadataReader;

Epub epub = new Epub("path/to/your/file.epub");
EpubBook book = epub.ReadEbook();

// Access metadata
string title = book.Metadata[0].Title[0];
string author = book.Metadata[0].Creators[0].Name;
string language = book.Metadata[0].Language[0];
string identifier = book.Metadata[0].Identifiers[0].UniqueID;

Load manually

Epub epub = new Epub();
EpubBook book = epub.ReadEbook("path/to/your/file.epub");

Check for errors

Epub epub = new Epub("path/to/your/file.epub");

if (epub.Errors.Count > 0)
{
    foreach (string error in epub.Errors)
    {
        Console.WriteLine(error);
    }
}

Reset and reuse

Epub epub = new Epub("path/to/first.epub");
EpubBook firstBook = epub.ReadEbook();

epub.Reset();
EpubBook secondBook = epub.ReadEbook("path/to/second.epub");

Data Model

Property Type Description
Book EpubBook The top-level container for all parsed data
Book.Metadata List<EpubBookMetadata> Dublin Core metadata (title, authors, language, etc.)
Book.Manifest List<EpubBookManifest> All content files referenced by the EPUB
Book.Spine List<EpubBookSpine> Reading order of manifest items
Book.Guide List<EpubBookGuide> Navigation references (cover, TOC, etc.)
Book.Package List<EpubBookPackage> OPF package information and namespaces
Errors IReadOnlyList<string> Any validation or parsing errors encountered

Metadata fields

Field Type Notes
Title List<string> Required by spec
Language List<string> Required by spec
Identifiers List<Identifier> Required by spec; includes ID, Scheme, and UniqueID
Creators List<Contributor> Authors; includes Name, Role, and FileAs
Contributors List<Contributor> Non-author contributors
Dates List<Date> Publication dates with optional event type
Publisher List<string>
Description List<string>
Subject List<string>
Rights List<string>
Type List<string>
Format List<string>
Source List<string>
Relation List<string>
Coverage List<string>

License

MIT � Damadar


Changelog

2.0.0

  • Bug fixes: Resolved multiple NullReferenceExceptions caused by missing optional attributes and uninitialized properties
  • Spec compliance: Required and optional OPF fields now correctly validated per the EPUB 2.0.1 specification
  • Error handling: Added Errors property exposing a read-only list of validation and parsing errors encountered during load
  • Duplicate detection: Improved duplicate detection across all sections using value-based comparisons; prevents duplicate manifest items, spine itemrefs, identifiers, creators, contributors, and guide references
  • Invalid node handling: Invalid nodes with missing required attributes are now skipped cleanly without polluting the output lists
  • Package validation: version and unique-identifier are now validated as required package attributes; missing values are logged as errors
  • Reset() fix: Error list is now cleared on reset
  • Constructor fix: EpubLocation is now correctly preserved when errors are logged during parsing
  • .NET Standard 2.0: Migrated target framework from .NET Framework to .NET Standard 2.0 for broader compatibility

1.0.0

  • Initial release
  • Reads OPF metadata from EPUB files (ZIP archives)
  • Supports EPUB 2.0 and 3.0 formats
  • Parses Dublin Core metadata: title, creators, contributors, identifiers, dates, publisher, description, subject, language, rights, type, format, source, relation, and coverage
  • Parses manifest items including ID, href, media-type, fallback, fallback-style, required-namespace, and required-modules
  • Parses spine itemrefs including idref and linear attributes
  • Parses guide references including type, title, and href
  • Parses package attributes including version, unique-identifier, and OPF/DC namespaces
  • Supports multiple OPF files within a single EPUB
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 132 2/28/2026
1.0.0 1,552 4/16/2017

Significant bug fixes and spec compliance improvements. Improved error handling and validation across all OPF sections.