agentsclimarketplace

Pdf text extraction

Skill cxcscmu/SkillLearnBench/skills/b1-one-shot-claude-opus-4-6/organize-messy-files/pdf-text-extraction

[COLM'26] SkillLearnBench is the first benchmark for evaluating continual learning methods that automatically generate agent skills.

Install
npx -y skills add cxcscmu/SkillLearnBench --skill pdf-text-extraction

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

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

SKILL.md

0.9 KB, as published. Nobody here has run it

PDF Text Extraction

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

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.