Repository navigation
Add get_pdf_title/get_epub_title, cheaper than get_*_index_data - #359
Merged
Merged
Conversation
benoit74
added a commit
to openzim/warc2zim
that referenced
this pull request
Oct 22, 2026
get_pdf_index_data also extracts the PDF's full text content, which we don't use here (only the title, to decide front-article status). Requires openzim/python-scraperlib#359.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #359 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 42 42
Lines 2801 2817 +16
Branches 416 416
=========================================
+ Hits 2801 2817 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
get_pdf_index_data/get_epub_index_data extract a document's full text content in addition to its title, even when only the title is needed. Add get_pdf_title/get_epub_title to get just the title from a document's own metadata, without the costly page-by-page text extraction.
benoit74
force-pushed
the
add-pdf-epub-title-only-helper
branch
from
October 22, 2026 08:00
2b7e7db to
9b5a78c
Compare
benoit74
added a commit
to openzim/warc2zim
that referenced
this pull request
Oct 22, 2026
get_pdf_index_data also extracts the PDF's full text content, which we don't use here (only the title, to decide front-article status). Requires openzim/python-scraperlib#359.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_pdf_index_data/get_epub_index_dataextract a document's full text content (page by page) in addition to its title, even when a caller only needs the title. This is unnecessary work when the content/full-text indexing isn't used.Add
get_pdf_title/get_epub_title: same title extraction logic (from the document's owntitle/author/subjectmetadata), without the page-by-page text extraction.Internally,
_get_document_index_dataand the new_get_document_titlenow share_open_document/_get_metadata_title/_log_mupdf_warningshelpers instead of duplicating the logic.This came up while fixing openzim/warc2zim#462:
warc2zimonly needs a PDF's title to decide whether to mark it as a front article, not its full text content.