For a python library for manipulating pdf files, the strongest matches are mstamy2/pypdf2 (This library provides a robust set of tools for), py-pdf/pypdf2 (This library provides a robust set of tools for) and pymupdf/pymupdf (PyMuPDF is a high-performance Python library that provides a). jsvine/pdfplumber and jbarlow83/ocrmypdf round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
We curate open-source GitHub repositories matching “best python pdf libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
PyPDF2 is a pure Python library for reading, writing, and manipulating PDF files. It functions as a document manipulator, text extractor, and encryption tool, allowing users to process PDF files without relying on external C libraries or native binaries. The library provides specialized tools for modifying document structures, such as merging multiple files into one, splitting documents into separate files, and transforming page layouts through cropping. It also includes capabilities for securing documents via passwords and encryption. Additional capabilities include the extraction of writte
This library provides a robust set of tools for reading, writing, merging, and splitting PDF documents, making it a core utility for programmatic PDF manipulation and text extraction in Python.
PyPDF2 is a pure Python library for transforming, securing, and extracting data from PDF documents. It provides a comprehensive suite of tools to modify page layouts, manage document security, and retrieve embedded metadata without relying on external C libraries. The toolkit enables document assembly through the merging of multiple files and the splitting of documents into smaller parts. It also supports page-level transformations, including the ability to rotate pages and adjust visible crop areas. The library includes capabilities for security management via password-based encryption and
This library provides a robust set of tools for PDF manipulation, merging, splitting, and text extraction, making it a core utility for programmatic PDF processing in Python.
PyMuPDF is a comprehensive PDF manipulation library and document analysis tool. It serves as a text extraction tool, OCR engine, and image converter, providing a programmatic interface to edit, merge, split, and optimize PDF and Office documents. The project distinguishes itself through high-performance capabilities, including the use of C-bindings for low-level manipulation and parallelized page processing to accelerate workloads. It provides specialized conversion paths, such as transforming PDF content into Markdown for retrieval-augmented generation and large language model pipelines. It
PyMuPDF is a high-performance Python library that provides a comprehensive suite of tools for PDF generation, text extraction, manipulation, and OCR integration, making it a flagship solution for programmatic document processing.
pdfplumber is a PDF data extraction library and layout analysis tool used to retrieve text, tables, and geometric objects from PDF files using precise coordinate-based analysis. It functions as a layout analyzer and table parser that identifies the bounding boxes and visual coordinates for every character and image on a page. The library distinguishes itself through visual debugging capabilities, allowing users to render PDF pages as images and draw annotations to verify the position of extracted data. It employs line and intersection analysis to identify cell structures and convert unstructu
This library is a specialized tool for extracting text, tables, and geometric data from PDFs, fitting the category well despite its primary focus on extraction rather than document generation or form filling.
OCRmyPDF is a tool for converting image-based PDF files into machine-readable documents by adding a searchable text layer via optical character recognition. It functions as a multi-language processor capable of detecting and extracting text in over 100 different languages using linguistic data packs. The software includes a PDF image optimizer to remove image artifacts and correct page skew to improve recognition accuracy. It also provides a converter to transform scanned documents into the PDF/A standard for long-term digital archiving. The system manages PDF optimization by compressing emb
This tool is a specialized Python-based utility for OCR-based text layer addition and PDF/A conversion, making it a highly effective library for specific PDF manipulation and archival tasks.
Marker is an LLM-powered document parser and OCR pipeline designed to convert PDFs and unstructured files into structured markdown, JSON, and HTML. It functions as a data preprocessor that transforms complex documents into machine-readable formats while preserving tables, equations, and layout structures. The system utilizes large language models to refine OCR accuracy, clean mathematical notation, and merge fragmented tables across multiple pages. It employs model-based layout analysis to predict block types and bounding boxes, ensuring a more precise conversion of document elements. Capabi
Marker is a specialized Python library for extracting structured data and text from PDFs using LLM-powered OCR and layout analysis, making it a highly effective tool for the extraction and conversion aspects of PDF processing.
pdfminer.six is a programmatic tool for extracting text, layout information, and metadata from PDF documents into machine-readable formats. It functions as a document parser that converts internal PDF objects and structures into accessible data objects for analysis. The project includes utilities for decrypting RC4 and AES encrypted files to enable content extraction. It also provides a layout analyzer to identify fonts, colors, and text locations to determine the organizational structure of pages. The system covers a broad range of extraction capabilities, including the retrieval of embedde
This library is a specialized tool for parsing and extracting text, layout, and metadata from PDF documents, though it focuses on analysis and extraction rather than PDF generation or creation.
pypdf is a Python library for parsing, manipulating, and generating PDF documents. It provides high-level operations for document processing, such as merging multiple files into one or splitting a single document into smaller files. The project includes specialized tools for managing interactive elements, including the creation and modification of annotations, hyperlinks, and form fields. It also supports advanced metadata management, allowing for the extraction and modification of standard document properties and XML-based XMP metadata. Beyond basic structural changes, the library covers pa
This library is a comprehensive tool for programmatic PDF generation, manipulation, and text extraction, though it lacks built-in OCR capabilities.
Camelot is a Python library and processing engine designed to extract tabular data from PDF documents. It converts unstructured tables into machine-readable formats such as CSV, JSON, and Excel. The project provides specialized toolsets for different document types, using line detection for ruled tables and whitespace analysis for borderless tables. It includes an optical character recognition system to recover structured data from image-based scanned PDFs that lack a digital text layer. The library handles complex document layouts, including encrypted files, rotated pages, and tables that s
Camelot is a specialized Python library focused on the extraction of tabular data from PDFs, which fits the category despite its narrow scope of focusing on tables rather than general-purpose PDF generation or manipulation.
MinerU is a document parsing pipeline designed to transform unstructured files into machine-readable, structured data. It utilizes deep learning models to perform layout analysis, identifying document regions and extracting complex content such as mathematical expressions. By combining these neural network inferences with geometric heuristics, the system reconstructs the reading order and structural hierarchy of documents to ensure accurate data representation. The project distinguishes itself through a multi-stage processing workflow that integrates layout detection, optical character recogn
MinerU is a specialized Python-based document parsing pipeline that excels at extracting structured data and text from complex PDFs using deep learning, making it a powerful tool for PDF data extraction and analysis.
Docling is a modular framework designed for document parsing, layout analysis, and structured data extraction. It transforms unstructured files and web content into a unified, hierarchical data model that preserves the spatial and semantic relationships between text, tables, images, and layout elements. By normalizing diverse input formats into a consistent internal representation, the library enables uniform processing across various document types. The project distinguishes itself through a schema-driven approach that maps document regions to strongly-typed objects, ensuring data accuracy t
Docling is a powerful Python framework for parsing and extracting structured data from PDFs, making it a highly capable tool for document processing even though its primary focus is on intelligent extraction rather than PDF generation or form filling.
A Python library for reading and writing PDF, powered by QPDF
This library provides robust capabilities for reading, writing, and manipulating PDF files by leveraging the QPDF engine, making it a strong choice for programmatic PDF processing despite lacking built-in OCR or form-filling features.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| mstamy2/pypdf2 | 10.1K | Python | NOASSERTION | |
| py-pdf/pypdf2 | 10.1K | Python | NOASSERTION | |
| pymupdf/pymupdf | 9.1K | Python | agpl-3.0 | |
| jsvine/pdfplumber | 9.7K | Python | mit | |
| jbarlow83/ocrmypdf | 33.9K | Python | MPL-2.0 | |
| vikparuchuri/marker | 36.2K | Python | GPL-3.0 | |
| pdfminer/pdfminer.six | 6.9K | Python | mit | |
| py-pdf/pypdf | 9.8K | Python | other | |
| camelot-dev/camelot | 3.8K | Python | MIT | |
| opendatalab/mineru | 67.7K | Python | NOASSERTION |