Registry / data / pdfid
library1.1.3pypypi✓ verified 79d ago

A Python library based on DidierStevens' PDFID tool for analyzing PDF files for malicious content. It scans PDFs for common suspicious elements like JavaScript, embedded files, and auto-actions. Current version 1.1.3, with intermittent releases.

pip install pdfid
INSTALL
IMPORT
SIG · PDFID
P
pdfid
datapythonv1.1.3
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.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 · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

PDFiD
import pdfid
from pdfid import PDFiD

Instantiate PDFiD with file content as bytes, then call results() for a dictionary of findings.

from pdfid import PDFiD # Analyze a PDF file with open('sample.pdf', 'rb') as f: data = f.read() pdfid = PDFiD(data) print(pdfid.results())
pdfid --version
Debug
Known issues
gotchaPDFiD expects the entire file content as bytes; passing a file path or file object will fail silently or raise an error.
fix
Open the file in binary mode and read all bytes before passing to PDFiD.
affects: >=1.0.0
gotchaThe results() method returns a dictionary with keys like 'JavaScript', 'OpenAction', etc. The values are the count of occurrences, not booleans.
fix
Check counts > 0 to determine presence: if pdfid.results().get('JavaScript', 0) > 0.
affects: >=1.0.0
Upgrade
Version history
1.1.3latest on PyPI · released Jun 6, 2023
Audit
Dependencies
pyewfoptionalRequired for parsing some PDF structures
Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
pdfid — pip install pdfid · libregistry