pypdf is a pure-Python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files.
The library addresses the need to programmatically manipulate PDF documents without external dependencies. It works by providing a pure-Python implementation that can read, parse, and modify PDF structures directly. Beyond page manipulation, it supports extracting text and metadata from PDFs, adding custom data and viewing options, and applying encryption and decryption with password protection.
Developers should choose pypdf for projects requiring PDF manipulation within Python applications where a lightweight, dependency-free solution is preferred. It suits workflows involving batch processing of PDFs, document assembly, or integration into larger Python systems. The library is particularly useful when AES encryption or decryption is needed, though this requires installing optional dependencies. The project maintains a CLI tool called pdfly for command-line PDF interactions.
The project actively solicits contributions across documentation, issue triage, and code submissions, with a stated preference for smaller pull requests that can be merged more quickly. The maintainers emphasize the importance of minimal reproducible examples in bug reports, requiring both code and example PDFs that demonstrate issues. The test suite is executed with pytest, and contributors are encouraged to add unit tests for new features and test cases for bug fixes. Community engagement occurs through StackOverflow questions, GitHub discussions, and issue tracking, with contributors helping users provide complete and verifiable examples.