Repolode
jsvine

jsvine/pdfplumber

A Python library and CLI for extracting text, tables, and detailed object data (chars, lines, rects) from machine-generated PDFs.

Open-source alternative to:Adobe Acrobat

Stars
10,833
Forks
935
Open issues
119
Last commit
6 days ago

What is it?

pdfplumber is a Python library for digging into the contents of PDF files. It exposes every character, rectangle, line, curve, and image on a page along with its position, font, and color, so developers can inspect a document at the level of individual drawing objects rather than only as plain text.

On top of this low-level access, it provides higher-level methods for extracting text with configurable spacing tolerances, locating words and search matches with their coordinates, and detecting tables from ruling lines or text alignment. Tables can be extracted as lists of rows and cells, and the table-finder can be tuned through a set of settings.

It includes visual debugging tools that render a page to an image and overlay detected lines, intersections, and tables, which helps when adjusting extraction settings. It is built on pdfminer.six and works best on machine-generated rather than scanned PDFs. A command-line interface can export objects as CSV, JSON, or text.

Key features

  • 01Access to individual chars, lines, rectangles, curves, and images with position and color data.
  • 02Text extraction with adjustable tolerances and an experimental layout mode.
  • 03Word and regex search returning bounding boxes.
  • 04Table detection from ruling lines, text alignment, or explicit coordinates.
  • 05Visual debugging that renders pages and overlays detected tables and lines.
  • 06Command-line export to CSV, JSON, or text.

Use cases

  • Extracting tables from financial or government PDF reports into Python data structures.
  • Pulling text with coordinates from invoices or forms for downstream parsing.
  • Tuning table extraction settings visually on difficult PDF layouts.
  • Inspecting the drawing objects inside a PDF for analysis or debugging.

Quick start

  1. 1

    Install pdfplumber from PyPI

    pip install pdfplumber
  2. 2

    Open a PDF and print the first character on the first page in Python

Things to know

  • Works best on machine-generated PDFs, not scanned documents.

Topics

FAQ

What is pdfplumber?
A Python library and CLI for extracting text, tables, and detailed object data (chars, lines, rects) from machine-generated PDFs. pdfplumber is a Python library for digging into the contents of PDF files. It exposes every character, rectangle, line, curve, and image on a page along with its position, font, and color, so developers can inspect a document at the level of individual drawing objects rather than only as plain text.
Is pdfplumber free to use? What license does it have?
pdfplumber is open source under the MIT license. Check the license terms before using it in commercial products.
Is pdfplumber still maintained?
Actively maintained. The last commit to pdfplumber was on Oct 15, 2026.
What can I use pdfplumber for?
Extracting tables from financial or government PDF reports into Python data structures. Pulling text with coordinates from invoices or forms for downstream parsing. Tuning table extraction settings visually on difficult PDF layouts. Inspecting the drawing objects inside a PDF for analysis or debugging.
How do I install pdfplumber?
Install pdfplumber from PyPI: pip install pdfplumber Open a PDF and print the first character on the first page in Python
Where can I get pdfplumber?
The source code and installation instructions are on GitHub: https://github.com/jsvine/pdfplumber

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects