Our take
- Activity
- 85
- Community
- 88
- Issues
- 66
- Pull requests
- 57
+22 stars in the last 16 days
- Releases more often than 85% of the projects we track
- Merges more pull requests than 79% of the projects we track
- More contributors than 77% of the projects we track
Overview
pypdf provides Python code for working with PDF files. It helps developers automate common document tasks, such as reading text and metadata, rearranging pages, and adding or changing document properties.
Use it when PDF handling needs to be part of a Python script or application. The project also links to pdfly, a separate command-line application built on pypdf.
Key Features
- Read PDF pages and extract text.
- Retrieve document metadata.
- Split and merge PDF files.
- Crop and transform pages.
- Create and read annotations.
- Add custom data and viewing options.
- Encrypt and decrypt PDFs, with an extra dependency for AES support.
Use Cases
- Python developers can extract text or metadata as part of a document-processing workflow.
- Teams can combine, split, or transform PDF pages in scripts and applications.
- Application developers can add annotations or custom data to generated or existing PDFs.
- Developers handling protected PDFs can use encryption and decryption features, installing the crypto extra when AES support is needed.
Getting Started
Install with pip:
pip install pypdf
For more examples and configuration details, see the README and documentation.
Alternatives
- pdfplumber: pdfplumber focuses on extracting text, tables, and positioned objects with layout inspection, while pypdf also edits pages and document data.
- pdfminer.six: pdfminer.six focuses on detailed text extraction and analysis, including layout and font data, while pypdf also supports PDF modification.
| Project | Language | License | Stars | Status |
|---|---|---|---|---|
| pypdf | Python | Other | 10.2k | Not checked yet |
| pdfplumber | Python | MIT | 10.8k | Quiet |
| pdfminer.six | Python | MIT | 7k | Quiet |
Considerations
- pypdf is a Python library, so it is suited to code-driven workflows rather than a standalone user interface. The linked pdfly project provides a CLI option.
- AES encryption and decryption require installing the optional crypto dependencies with
pip install pypdf[crypto]. - The repository's license field is reported as
NOASSERTION; check the repository for licensing details before adopting it.
Found this useful?
Share it with someone who would like pypdf.