Skip to content

feat: add PDF skill (extract, search, split, merge) - #2016

Closed
Mibayy wants to merge 1 commit into
NousResearch:mainfrom
Mibayy:feat/pdf-skill
Closed

feat: add PDF skill (extract, search, split, merge)#2016
Mibayy wants to merge 1 commit into
NousResearch:mainfrom
Mibayy:feat/pdf-skill

Conversation

@Mibayy

@Mibayy Mibayy commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a PDF processing skill. Requires one dependency: pip install pypdf.

Features

  • 6 commands: extract, metadata, info, search, split, merge
  • Smart page selection — ranges (1-5), lists (1,3,7), or all
  • Regex search — find patterns across all pages with context
  • Graceful fallback if pypdf not installed (helpful install message)

Usage

python3 pdf_client.py extract report.pdf
python3 pdf_client.py extract report.pdf --pages 1-5 --output json
python3 pdf_client.py metadata report.pdf
python3 pdf_client.py info report.pdf
python3 pdf_client.py search report.pdf "revenue"
python3 pdf_client.py split report.pdf --pages 1-10
python3 pdf_client.py merge a.pdf b.pdf c.pdf --output combined.pdf

Files

  • optional-skills/productivity/pdf/SKILL.md
  • optional-skills/productivity/pdf/scripts/pdf_client.py (~430 lines)

Notes

  • Handles encrypted PDFs (tries empty password first)
  • Scanned/image-only PDFs handled gracefully with clear message

6 commands: extract, metadata, info, search, split, merge
Requires: pip install pypdf
Smart page selection, regex search, image detection.
@teknium1

Copy link
Copy Markdown
Contributor

Closing in favor of extending the existing ocr-and-documents skill (merged in PR #2461).

The existing skill already covers text extraction and metadata via pymupdf (which is more capable than pypdf). Split, merge, and search examples have been added to it — pymupdf handles all three natively with just a few lines of code, so a separate 430-line CLI script isn't needed.

Thanks for the contribution idea @Mibayy — the capabilities you identified were worth adding, just in a lighter form.

@teknium1 teknium1 closed this Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants