Registry / data / pdfquery

pdfquery

JSON →
library0.4.3pypypiunverified

PDFQuery is a lightweight Python library for scraping data from PDFs using JQuery-like CSS selectors or XPath expressions. It wraps pdfminer and lxml to provide a concise API for extracting text, tables, and layouts. Version 0.4.3 is the latest, with no active development since 2016.

pip install pdfquery
INSTALL
IMPORT
SIG · PDFQUERY
P
pdfquery
datapythonv0.4.3
Install
4.7s avg
Import
Disk
58MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 59.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.7s · import 0.000s · 61MB
58MB installed
● package 58MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PDFQuery
from pdfquery import PDFQuery

Load a PDF and extract text lines using JQuery-like selectors via pyquery.

from pdfquery import PDFQuery pdf = PDFQuery('sample.pdf') pdf.load() # Extract text using CSS selector text = pdf.pq('LTTextLineHorizontal').text() print(text) # Extract with XPath text2 = pdf.pq('LTTextLineHorizontal:contains("Invoice")').text() print(text2)
Debug
Known issues
gotchaPDFQuery depends on pdfminer.six, not the older pdfminer. If both are installed, import conflicts may occur.
fix
Uninstall old pdfminer: pip uninstall pdfminer; ensure pdfminer.six is installed.
affects: all
deprecatedpdfquery is unmaintained since 2016. Compatibility with newer Python versions (3.10+) is not guaranteed. Consider alternatives like pypdf or pdfplumber.
fix
Test with your Python version; if issues arise, switch to pdfplumber or pypdf.
affects: >=0.4.3
gotchaThe library uses pyquery which is case-sensitive for tags. Common mistake: 'LTTextLineHorizontal' not 'lttextlinehorizontal'.
fix
Use exact case: LTTextLineHorizontal, LTTextBox, etc.
affects: all
Upgrade
Version history
0.4.3latest on PyPI · released Mar 27, 2016
Audit
Dependencies
pdfminer.sixrequiredBackend for PDF parsing; pdfquery requires pdfminer.six (not pdfminer).
lxmlrequiredXML/HTML parsing for PDF internal structure.
pyqueryrequiredProvides JQuery-like selectors.
Agent activity
2 hits · last 30 days
node
2
Resources
pdfquery — pip install pdfquery · libregistry