Skip to content

split-pdf: extract splitter into scripts/ and switch backend to pypdf#15

Open
nsmiller2501 wants to merge 3 commits into
scunning1975:mainfrom
nsmiller2501:followup/split-pdf-pypdf
Open

split-pdf: extract splitter into scripts/ and switch backend to pypdf#15
nsmiller2501 wants to merge 3 commits into
scunning1975:mainfrom
nsmiller2501:followup/split-pdf-pypdf

Conversation

@nsmiller2501
Copy link
Copy Markdown

Summary

Follow-on to #5. Two changes to /split-pdf:

  1. Extract the inline PDF-splitting logic into a standalone Python script at .claude/skills/split-pdf/scripts/split.py.
  2. Swap the PDF backend from PyPDF2 to pypdf (drop-in API).

What changed

  • New .claude/skills/split-pdf/scripts/split.py: takes the previously inline PdfReader / PdfWriter chunking logic and packages it as a reusable CLI script.
  • SKILL.md shrinks: the deterministic chunking steps are replaced with a single script invocation; only the protocol prose remains.
  • All PyPDF2 references (script import, SKILL.md install hint, README copy in both .claude/skills/ and skills/) updated to pypdf.

Why

  • Script extraction: keeps the deterministic chunking logic out of the LLM context, makes it independently testable, and matches the pattern used by other skills (e.g. /bibcheck/scripts/split_bib.py).
  • PyPDF2 → pypdf: PyPDF2 is unmaintained; pypdf is its maintained successor and exposes a drop-in-compatible PdfReader / PdfWriter API. The migration is a one-line import change with no behavior difference for fixed-size chunking.

Testing

  • Ran python3 .claude/skills/split-pdf/scripts/split.py path/to/sample.pdf and confirmed the resulting chunk layout matches the prior inline behavior.
  • Verified pip install pypdf works on Python 3.10+ and the script imports cleanly.
  • No behavioral change in the split output expected.

PyPDF2 is unmaintained. pypdf is the maintained successor with a
drop-in-compatible PdfReader/PdfWriter API. Swap the import in
scripts/split.py and update SKILL.md / README.md text.
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.

1 participant