# PDFluent for Python — install with pip

Source: https://pdfluent.com/docs/python/

Channel guide

# PDFluent for Python

Generally available Updated 2026-05-14

[Star on GitHub](https://github.com/pdfluent/pdfluent-sdk)

### On this page

- Install
- Smoke test
- Structured extraction (Preview)
- What this is good for
- Current limitations
- Licensing
- Where to go next

## Install

One command. The package is on [PyPI](https://pypi.org/project/pdfluent/) today.

`pip install pdfluent==1.5.0`

## Smoke test

Open a PDF, print the page count. The example below is the smallest useful program — copy, paste, run.

python

```
import pdfluent

doc = pdfluent.open("invoice.pdf")
print(f"{doc.page_count()} pages")
```

## Structured extraction (Preview)

Preview In Python, structured extraction returns Markdown from `doc.extract_markdown`, blocks from `doc.extract_blocks`, words from `doc.extract_words`, Docling JSON from `doc.extract_docling`, and chunks from `pdfluent.chunks.iter_chunks`. Structured extraction ships as Preview: output quality is still improving and the API may change in a minor release.

- Tiers: `fast` (default, the engine alone, no models) and `balanced` (Preview, native only, needs installed models).
- Enable balanced with `quality="balanced"`; set model paths with `model_dir=` and `table_model_dir=`.
- Docling JSON: `doc.extract_docling(first_page=0, page_count=None, name="document")`.
- Page window: `first_page` (from zero) and `page_count`; `iter_chunks(doc, mode="markdown")` yields chunks with `.text`.

Guides: [Structured extraction](https://pdfluent.com/how-to/extraction/) · [Output formats](https://pdfluent.com/how-to/extraction-formats/) · [PyMuPDF-style Python API](https://pdfluent.com/how-to/pymupdf-compat/) · [1.1.0 release](https://pdfluent.com/blog/sdk-1-1-0-structured-extraction/)

python

```
from pdfluent import Document
from pdfluent.chunks import iter_chunks

with Document("report.pdf") as doc:
    md = doc.extract_markdown()                        # fast tier, no models
    md_tables = doc.extract_markdown(quality="balanced")  # needs installed models
    words = doc.extract_words()
    for chunk in iter_chunks(doc, mode="markdown"):
        print(chunk.text)
```

SDK 1.1.0 for Python includes a compat layer that follows part of the PyMuPDF API. Coverage is partial and behaviour can differ in places, and it is an independent implementation, not PyMuPDF. The exact names in that namespace were under legal review as of 2026-10-08, so this page does not list them. Check the 1.1.0 release notes before building against that namespace.

## What this is good for

- Data and document pipelines
- Batch processing of invoices, archives, and statements
- Notebooks and scripted automation

## Current limitations

This list is honest, not exhaustive. The site-wide list lives at [Known limitations](https://pdfluent.com/docs/known-limitations/).

- Pre-built wheels target common architectures; some platforms may need a build-from-source step.
- XFA rendering fidelity is improving alongside the Rust core; complex dynamic forms may render with visual deltas.

## Licensing

PDFluent is published under the AGPLv3 and is complete under it. A yearly commercial licence removes the obligation to publish your own source; nothing in the build differs and nothing is activated, so a lapsed licence breaks nothing you have shipped. Details on the [licensing page](https://pdfluent.com/docs/licensing/).

## Where to go next

- [Open PyPI Browse versions and the published API.](https://pypi.org/project/pdfluent/)
- [View pricing Annual licences with perpetual-fallback.](https://pdfluent.com/pricing/)
- [Contact licensing We respond within one business day.](mailto:hello@pdfluent.com?subject=Licensing)
- [All language channels The hub lists all language channels.](https://pdfluent.com/docs/)
