pdfluent-extract
PDF and Office files to Markdown, JSON and RAG chunks, in three calls. It is
pure Python: the engine underneath is
pdfluent, which pip pulls in
automatically. There is nothing to compile and no system dependency to
install — on Linux arm64 and Alpine/musl as much as anywhere else, because
pdfluent 1.1.0 ships a wheel for every platform in the matrix below.
Install
pip install pdfluent-extract
It needs Python 3.8 or later and pdfluent 1.1.0 or later.
Use
from pdfluent_extract import to_markdown
print(to_markdown("report.pdf"))
to_markdown takes a path, bytes or a file-like object, and routes PDF and
Office (.docx/.pptx/.xlsx) by magic bytes, not by the extension. pages
lists 0-based PDF page indices (None for the whole file).
from pdfluent_extract import to_json
doc = to_json("report.pdf")
print(doc["name"], len(doc["texts"]))
to_json returns the file as a Docling DoclingDocument, as a dict — the
same JSON DoclingDocument.model_validate_json reads.
Command line
$ pdfluent-extract report.pdf -o report.md
$ pdfluent-extract report.pdf --format json --pages 1-3 > doc.json
$ cat report.pdf | pdfluent-extract - --format text
--format is one of md, json, chunks or text; --pages counts
from 1 (1-3,5). Without -o (or with -o -) the output goes to stdout.
Chunks for RAG
from pdfluent_extract import to_chunks
for chunk in to_chunks("report.pdf", max_tokens=512):
print(chunk.metadata["page"], chunk.metadata["section_path"], chunk.text[:80])
One chunk per paragraph, heading and list item, and one per table. Every chunk
carries page, section_path (the enclosing headings) and bbox in its
metadata, plus source for path inputs. Tables longer than the budget split
by rows with the header repeated. PDF only in v1.
With LangChain and LlamaIndex
pip install "pdfluent-extract[langchain]"
from langchain_pdfluent import PDFluentLoader
docs = PDFluentLoader("report.pdf").load()
print(docs[0].page_content, docs[0].metadata["bbox"])
pip install "pdfluent-extract[llamaindex]"
from llama_index.readers.pdfluent import PDFluentReader
docs = PDFluentReader().load_data("report.pdf")
print(docs[0].text[:200])
Supported platforms
Every platform pdfluent 1.1.0 ships a wheel for: macOS (universal2),
Windows x64, Linux x86_64 and arm64 on glibc (manylinux2014) and musl
(musllinux_1_2) — Python 3.8 through 3.13 from one abi3 wheel per platform.
Quality
quality="fast" is the only level in v1; anything else is refused by name.
Further levels (vision/OCR) are designed later.
Licence
AGPL-3.0 or a commercial licence, at your option; see LICENSE and
LICENSE-COMMERCIAL. The commercial licence is sold yearly and self-service
at https://pdfluent.com/sdk/pricing/.
Metadata
Release files for pdfluent-extract 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pdfluent_extract-0.1.0.tar.gz | 30.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pdfluent_extract-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.3 kB
Release files / pdfluent_extract-0.1.0.tar.gz
| Download URL | pdfluent_extract-0.1.0.tar.gz |
|---|---|
| Size | 30.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a234b5061b920845c719d5ec26183c61d19d9b47efa2e7c8a0c2750e0fd6e60
|
|
BLAKE2b-256 checksum How to use checksums |
2331ba6081166ef8f21a65dcd34075753df2b83d188995b9abe994f1ab8a88f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Release files / pdfluent_extract-0.1.0-py3-none-any.whl
| Download URL | pdfluent_extract-0.1.0-py3-none-any.whl |
|---|---|
| Size | 24.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2813e10b7cee90ffd5a3a5e79b36bdaa986a9e03281038e60d0d8813f8f74f1d
|
|
BLAKE2b-256 checksum How to use checksums |
221fc884e0886d2b48ae5f05cb9d643955338806b2854c5ab6fdd4ce0e32dd77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Security for pdfluent-extract 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.