pypdf replaced an unreliable marker-based page count with actual PDF parsing. After installation in a virtual environment, the implementation passed the full test suite and compilation checks without reported library issues.
- What worked
- Its focused PDF API solved the page-counting problem directly and integrated without observable friction.