PDF Text Extraction

SkillFiles & storage

Extract text from PDF files using Python libraries (PyPDF2, pdfplumber) for content analysis and classification.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the PDF Text Extraction skill

What this skill tells your AI

The instructions your AI receives, as published by cxcscmu/skilllearnbench in skills/b1-one-shot-claude-opus-4-6/organize-messy-files/pdf-text-extraction/SKILL.md and read by ahel’s review.

Libraries

  • PyPDF2: Fast, good for simple text extraction
  • pdfplumber: Better for complex layouts, tables

Usage Pattern

import PyPDF2

def extract_pdf_text(filepath, max_pages=3):
    """Extract text from first few pages of a PDF for classification."""
    text = ""
    try:
        with open(filepath, 'rb') as f:
            reader = PyPDF2.PdfReader(f)
            for i, page in enumerate(reader.pages[:max_pages]):
                text += page.extract_text() or ""
    except Exception:
        pass
    return text

Tips

  • Reading only the first 2-3 pages is usually sufficient for topic classification
  • Some PDFs have no extractable text (scanned images) - fallback to filename
  • Always wrap in try/except as some PDFs may be corrupted

Signals

GitHub stars
83
Forks
5
Last commit
Jul 2026
Advanced
Catalog kind
skill
Gateway key
pdf-text-extraction
Source
github.com/cxcscmu/skilllearnbench