Python PDF table extraction libraries

Updated Nov 2026

Python PDF table extraction libraries find tables on PDF pages and return their rows and cells as data. A text-based extractor reads the characters and ruling lines stored in a digital PDF rather than recognizing text from page images. These libraries let data pipelines and AI agents load tables from reports, invoices, and filings into DataFrames.

Popularity

PyMuPDF has the most monthly downloads in this comparison, at 171.3M, a count that covers all its PDF work.

LibraryMonthly downloadsStarsLast releaseLicense
PyMuPDF
171.3M
11.2KNov 2026AGPL-3.0 or commercial
pdfplumber
69.7M
10.9KJun 2026MIT
Docling
4.3M
70.8KNov 2026MIT
Unstructured
2.6M
15.8KNov 2026Apache-2.0
Camelot
2.4M
3.9KJun 2026MIT
tabula-py
1.8M
2.3KNov 2026MIT
pdf2docx
1.8M
3.5KMay 2026MIT
PaddleOCR
1.4M
92.9KJun 2026Apache-2.0
Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Extracts, analyzes, converts, and edits PDF and other documents.

Downloads / mo
171.3M
Stars
11.2K
Last release
2.1
License
AGPL-3.0 or commercial

Quickstart

From page.html
$ python3.11 -m pip install pymupdf==2.1
import sys
import pymupdf

with pymupdf.open(sys.argv[1]) as document:
    print([table.extract() for table in document[0].find_tables().tables])

PyMuPDF examples

From open-source projects on GitHub

Extracts table rows while exposing cells, edges, and page geometry.

Downloads / mo
69.7M
Stars
10.9K
Last release
0.11.10
License
MIT

Strengths

  • Exposes table cells and bounds. Inspect cells, rows, columns, and bounding boxes before extracting values.
  • Crops before table extraction. Crop the page to focus extraction on the relevant table area.

Limitations

  • Scanned PDFs. Handles machine-generated PDFs more reliably than scanned PDFs.
$ python3.11 -m pip install pdfplumber==0.11.10
import sys
import pdfplumber

with pdfplumber.open(sys.argv[1]) as document:
    print(document.pages[0].extract_tables())

pdfplumber examples

From open-source projects on GitHub

Parses PDF, DOCX, HTML, and other formats into one document representation.

Downloads / mo
4.3M
Stars
70.8K
Last release
2.150.1
License
MIT

Quickstart

From document_converter.py
$ python3.11 -m pip install docling==2.150.1 pandas tabulate
import sys
from docling.document_converter import DocumentConverter

result = DocumentConverter().convert(sys.argv[1])
print([table.export_to_dataframe(doc=result.document) for table in result.document.tables])

Unstructured

Prepares raw documents for machine learning tasks.

Downloads / mo
2.6M
Stars
15.8K
Last release
0.27.37
License
Apache-2.0

Quickstart

From pdf.py
$ python3.11 -m pip install "unstructured[pdf]==0.27.37"
import sys
from unstructured.partition.pdf import partition_pdf

elements = partition_pdf(filename=sys.argv[1], strategy="hi_res", infer_table_structure=True)
print([element.metadata.text_as_html for element in elements if element.category == "Table"])

Extracts PDF tables using selectable rule-based or optional neural parsers.

Downloads / mo
2.4M
Stars
3.9K
Last release
2.0.0
License
MIT

Strengths

  • Chooses parsers for different layouts. Use lattice for ruled tables or stream for whitespace-separated tables.
  • Exports tables directly. Save extracted tables as CSV, JSON, or HTML.

Limitations

  • Scanned pages need OCR extras. Install the neural and OCR extras, then select the ml parser.
  • Reads the first page initially. Set pages explicitly to extract tables beyond the first page.

Quickstart

From README.md
$ python3.11 -m pip install camelot-py==2.0.0
import sys
import camelot

tables = camelot.read_pdf(sys.argv[1])
print([table.df for table in tables])

Camelot examples

From open-source projects on GitHub

Wraps the Java table-extraction engine with Python data-frame and file conversion APIs.

Downloads / mo
1.8M
Stars
2.3K
Last release
2.11.0
License
MIT

Strengths

  • Handles ruled and unruled tables. Choose lattice for cell borders or stream for tables without borders.
  • Targets a selected page area. Pass area to limit extraction to the chosen page rectangle.

Limitations

  • Requires a working Java installation. Install Java and make its command available to the Python process.
  • Reads the first page initially. Use pages="all" when the whole document should be searched.

Quickstart

From README.md
$ python3.11 -m pip install tabula-py==2.11.0
import sys
import tabula

print(tabula.read_pdf(sys.argv[1], pages="all"))

Converts PDF to DOCX.

Downloads / mo
1.8M
Stars
3.5K
Last release
0.5.13
License
MIT

Quickstart

From quickstart.table.rst
$ python3.11 -m pip install pdf2docx==0.5.13
import sys
from pdf2docx import Converter

converter = Converter(sys.argv[1])
try:
    print(converter.extract_tables(start=0, end=1))
finally:
    converter.close()

Runs multilingual OCR and document parsing on PaddlePaddle.

Downloads / mo
1.4M
Stars
92.9K
Last release
3.7.0
License
Apache-2.0

Quickstart

From README.md
$ python3.11 -m pip install "paddleocr[doc-parser]==3.7.0" paddlepaddle==3.3.0
import sys
from paddleocr import PPStructureV3

pipeline = PPStructureV3(use_table_recognition=True)
for result in pipeline.predict(input=sys.argv[1]):
    result.save_to_html(save_path="table-output")

FAQ

pdfplumber suits digital PDFs where table settings need tuning against characters and lines. Camelot suits table-only extraction straight into pandas DataFrames. Docling suits whole-document conversion with optional OCR for scanned pages.

Docling converts PDF, DOCX, HTML, and other formats into one document model that includes tables. It runs locally and can use optional OCR backends.

pdfplumber exposes every character, line, and rectangle on a PDF page and finds tables from them. Its extract_tables method returns nested lists of cells rather than DataFrames.

Camelot and tabula-py read PDF tables directly into pandas DataFrames. tabula-py wraps tabula-java and requires a Java runtime.

Camelot is a dedicated PDF table parser that returns pandas DataFrames, with lattice, stream, network, and hybrid parsing modes.

For coding agents

Found your PDF table extraction library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official