pikepdf
Read, write, repair, and transform PDFs in Python, powered by qpdf
Decision gist · record as of 2026-08-14
Yes. pikepdf is production-ready (stable since 2017, actively maintained, no known vulnerabilities), has broad platform support via pre-built wheels, and solves real PDF manipulation problems that pure-Python libraries struggle with. The MPL-2.0 license is permissive for most use cases. Install it if you need to repair, merge, encrypt, or manipulate existing PDFs; skip it if you only need text extraction or PDF rendering.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; binary wheels available for most platforms, but source builds require a C++ compiler.
- Medium install friction due to compiled C++ dependencies, but binary wheels are pre-built for common platforms (Linux, macOS, Windows on x86-64 and ARM64) requiring no compiler.
- Active maintenance with a release 14 days ago and 2789 repository stars.
License · maintenance · safety
MPL-2.0 (copyleft) — Licensed under MPL-2.0 (copyleft), which requires source code disclosure of modifications to pikepdf itself but permits both open and closed source projects to use it. Compatible with most commercial and open source projects.
last release 2026-07-31 (14 days) · last repo commit 2026-08-06 · 2,789 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 10,269,759 downloads/mo, #1,463 on PyPI
Alternatives
Verify before relying
pip install pikepdf
import pikepdf
with pikepdf.Pdf.open('input.pdf') as pdf:
num_pages = len(pdf.pages)
del pdf.pages[-1]
pdf.save('output.pdf')- Whether qpdf's automatic repair handles all common PDF corruption patterns in practice
- Performance characteristics for very large PDFs or batch operations
What it is and what it does
pikepdf is a Python wrapper around qpdf, a mature C++ PDF library, that lets you read, modify, and repair PDF documents programmatically. It handles page operations (merge, split, rotate, rearrange), metadata editing (XMP and DocumentInfo), encryption/decryption (AES-256, AES-128, RC4), lossless image extraction, and direct access to PDF objects. The library automatically repairs structural damage when opening malformed PDFs, making it useful for sanitizing or normalizing documents.
It runs on modern Python (3.10+) and comes pre-built for Linux, macOS, and Windows on both x86-64 and ARM64 architectures, including free-threaded CPython 3.14. Three runtime dependencies (Pillow, lxml, packaging) keep the footprint manageable. pikepdf is not designed for PDF generation from HTML/templates, rendering to images, or text extraction—other libraries are better suited for those tasks.
Use it for
- Merge multiple PDFs into a single document or split and rearrange pages across files
- Repair damaged or malformed PDFs automatically on open, then save corrected versions
- Edit PDF metadata (title, author, creation date) and XMP properties programmatically
- Extract images from PDFs losslessly without re-encoding JPEG or other compressed formats
- Open password-protected PDFs and re-save with different encryption or no encryption
- Optimize PDFs for web delivery using linearization (fast web view)
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
pikepdf is production-ready (stable since 2017, actively maintained, no known vulnerabilities), has broad platform support via pre-built wheels, and solves real PDF manipulation problems that pure-Python libraries struggle with. The MPL-2.0 license is permissive for most use cases. Install it if you need to repair, merge, encrypt, or manipulate existing PDFs; skip it if you only need text extraction or PDF rendering.
Install
pikepdf on PyPI
Before you install
Medium install friction due to compiled C++ dependencies, but binary wheels are pre-built for common platforms (Linux, macOS, Windows on x86-64 and ARM64) requiring no compiler. Active maintenance with a release 14 days ago and 2789 repository stars.
Requires Python 3.10 or later; binary wheels available for most platforms, but source builds require a C++ compiler.
License in practice
Licensed under MPL-2.0 (copyleft), which requires source code disclosure of modifications to pikepdf itself but permits both open and closed source projects to use it. Compatible with most commercial and open source projects.
Quickstart
pip install pikepdf
import pikepdf
with pikepdf.Pdf.open('input.pdf') as pdf:
num_pages = len(pdf.pages)
del pdf.pages[-1]
pdf.save('output.pdf')
Verify before relying
- Whether qpdf's automatic repair handles all common PDF corruption patterns in practice
- Performance characteristics for very large PDFs or batch operations
Package facts
| License | MPL-2.0 copyleft |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 3 packagesPillowlxmlpackaging |
| Maintenance | Actively maintained 14 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 10,269,759 / month, #1,463 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyProgramming Language :: C++Programming Language :: Python :: 3Programming Language :: Python :: Free Threading :: 3 - StableProgramming Language :: Python :: Implementation :: CPythonTopic :: Multimedia :: GraphicsTopic :: Software Development :: Libraries |
Evidence: pikepdf-10.11.0-cp310-cp310-macosx_14_0_arm64.whl; pikepdf-10.11.0-cp310-cp310-macosx_15_0_x86_64.whl; pikepdf-10.11.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pikepdf-10.11.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pikepdf-10.11.0-cp310-cp310-musllinux_1_2_aarch64.whl; pikepdf-10.11.0-cp310-cp310-musllinux_1_2_x86_64.whl; pikepdf-10.11.0-cp310-cp310-win_amd64.whl; pikepdf-10.11.0-cp311-cp311-macosx_14_0_arm64.whl; pikepdf-10.11.0-cp311-cp311-macosx_15_0_x86_64.whl; pikepdf-10.11.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pikepdf-10.11.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pikepdf-10.11.0-cp311-cp311-musllinux_1_2_aarch64.whl; pikepdf-10.11.0-cp311-cp311-musllinux_1_2_x86_64.whl; pikepdf-10.11.0-cp311-cp311-win_amd64.whl; pikepdf-10.11.0-cp312-cp312-macosx_14_0_arm64.whl; pikepdf-10.11.0-cp312-cp312-macosx_15_0_x86_64.whl; pikepdf-10.11.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pikepdf-10.11.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pikepdf-10.11.0-cp312-cp312-musllinux_1_2_aarch64.whl; pikepdf-10.11.0-cp312-cp312-musllinux_1_2_x86_64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pdf merge split rotate pages”
- pikepdfpikepdf reads, writes, repairs, and transforms PDF documents through…
- pdfrwpdfrw reads, writes, and manipulates PDF files in pure Python,…
- pdfrw2pdfrw2 reads, writes, and manipulates PDF files with operations…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also PyPDF4 · PyPDF3 · pdfrw · pdfrw2 · PyPDF2 · ocrmypdf · pdfservices-sdk · convertapi · pypdf · pypdfium2