pdf-extractor
SKILL.md
PDF Extraction Instructions
Overview
This skill extracts text and data from PDF files using Python libraries.
Usage
Basic Text Extraction
import pdfplumber
with pdfplumber.open("document.pdf") as pdf:
for page in pdf.pages:
text = page.extract_text()
print(text)
Extract Tables
import pdfplumber
with pdfplumber.open("document.pdf") as pdf:
for page in pdf.pages:
tables = page.extract_tables()
for table in tables:
print(table)
Get Metadata
from pypdf import PdfReader
reader = PdfReader("document.pdf")
metadata = reader.metadata
print(f"Title: {metadata.title}")
print(f"Author: {metadata.author}")
print(f"Pages: {len(reader.pages)}")
Requirements
Install the required packages:
pip install pypdf pdfplumber
Notes
- For scanned PDFs, consider using OCR libraries like
pytesseract - Large PDFs should be processed page by page to manage memory
Weekly Installs
1
Repository
smithery/aiFirst Seen
7 days ago
Installed on
amp1
opencode1
kimi-cli1
codex1
github-copilot1
gemini-cli1