Fetching Metadata

Using Calibre’s `fetch-ebook-metadata`_ tool, looks up metadata based on title, author, and/or ISBN

..fetch-ebook-meta: https://manual.calibre-ebook.com/generated/en/fetch-ebook-metadata.html

capybre.fetch_metadata.fetch_cover(title=None, author=None, isbn=None, output_file='cover.jpg')

Downloads cover to specified file

As it is impossible to download without also fetching metadata, also returns the metadata

At least one of title, author, or ISBN is required; it is suggested to either provide ISBN or both title and author. In the case of multiple books matching a particular set of identifiers, the first one found will be returned

Parameters:
  • title (str, optional) – Title of the book
  • author (str, optional) – Author of the book
  • isbn (str, optional) – Book’s ISBN code
Returns:

Metadata object

capybre.fetch_metadata.fetch_metadata(title=None, author=None, isbn=None) → capybre.metadata.Metadata

Extracts metadata about an ebook, returning a Metadata object. At least one of title, author, or ISBN is required; it is suggested to either provide ISBN or both title and author. In the case of multiple books matching a particular set of identifiers, the first one found will be returned

Parameters:
  • title (str, optional) – Title of the book
  • author (str, optional) – Author of the book
  • isbn (str, optional) – Book’s ISBN code
Returns:

Metadata object

capybre.fetch_metadata.fetch_metadata_map(title=None, author=None, isbn=None)

Extracts metadata about an ebook, returning a dict. At least one of title, author, or ISBN is required; it is suggested to either provide ISBN or both title and author. In the case of multiple books matching a particular set of identifiers, the first one found will be returned

Parameters:
  • title (str, optional) – Title of the book
  • author (str, optional) – Author of the book
  • isbn (str, optional) – Book’s ISBN code
Returns:

Dict mapping between metadata keys and values as directly output from

the ebook-meta call

class capybre.fetch_metadata.fetched_metadata_and_cover(title=None, author=None, isbn=None)

Fetches the cover image and metadata info inside a context. For use like:

with fetched_metadata_and_cover(title='pride and prejudice') as metadata, cover:
    upload(cover, metadata)