Conversation
Add PDFFile document class for comparing text-based PDF files. Uses pdfplumber for text extraction with support for page-level access. - New PDFFile class extending Document with text, pages, and page_count properties - Optional preserve_pages parameter to insert [Page N] markers - CLI auto-detects .pdf files and extracts text automatically - PDF support is an optional dependency: pip install redlines[pdf] Closes #1 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add PDF optional dependency to installation sections in README, AGENT_GUIDE, and __init__.py - Add Pattern 1b for comparing PDF files in AGENT_GUIDE - Add PDF to API documentation list in __init__.py - Add PDF example to CLI docstring Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add comprehensive module-level docstring with usage examples - Expand PDFPage dataclass docstring with example - Enhance PDFFile class docstring with features, limitations, and multiple examples - Add detailed docstrings to all properties (text, pages, page_count) - Add docstring to _extract_text method - Follow project style with Sphinx-style parameter documentation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
e3decf2 to
6dee1fd
Compare
- Update module docstring: emphasize text dump implementation - Update class docstring: note limitations for complex documents - Brief and factual about multi-column, table, header/footer handling Related: #84 (future enhancements) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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
PDFFiledocument class for comparing text-based PDF filespdfplumberlibrary for text extraction (MIT license, supports word-level bounding boxes for future chunk comparison features)pip install redlines[pdf].pdffiles and handles them automaticallyImplementation Notes
This is a text dump implementation - extracts plain text only using
page.extract_text():Usage
# CLI usage - auto-detects PDF files redlines json doc_v1.pdf doc_v2.pdf --prettyFeatures
PDFFile.text- Extracted text from all pagesPDFFile.pages- List ofPDFPageobjects withpage_numberandtextPDFFile.page_count- Number of pagespreserve_pages=Trueoption to insert[Page N]markers in textTest plan
pytest tests/test_pdf.py -v- 9 tests passpytest tests/- 123 pass, 12 skipped (nupunkt)mypy redlines/- no issuesCloses #1
🤖 Generated with Claude Code