--- id: pikepdf version: "10.11.0" license: MPL-2.0 license_treatment: copyleft maintenance: active --- # pikepdf — Read, write, repair, and transform PDFs in Python, powered by qpdf License: copyleft · Maintenance: active · Downloads: 10.3M/mo ## 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 above — verify before relying. pikepdf reads, writes, repairs, and transforms PDF documents through a Python interface backed by the qpdf C++ library, handling page manipulation, metadata editing, encryption, and low-level PDF object access. 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 pip install pikepdf uv add pikepdf poetry add pikepdf ## Installing pikepdf 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. 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') Requires Python 3.10 or later; binary wheels available for most platforms, but source builds require a C++ compiler. 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_current - Install friction: medium - Maintenance: active - Downloads: 10.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pdf manipulation python, pdf merge split rotate pages, pdf repair damaged files, pdf encryption decryption, extract images from pdf, pdf metadata editing, pdf linearization optimization, pdf-manipulation, document-processing, encryption [View on SkillFed](https://skillfed.io/packages/pikepdf) · [View on PyPI](https://pypi.org/project/pikepdf/)