feat: add Mathpix PDF extraction - #26
Open
m-messer wants to merge 1 commit into
Open
Conversation
in2lambda/wizard/mathpix.py: pdf_to_markdown() uploads a PDF to the Mathpix OCR API, polls for the rendered markdown, downloads any remote figures into <out_dir>/media/, and repoints the markdown at ./media/<name> so the Markdown filter's image resolution finds them. - Credentials from $MATHPIX_APP_ID / $MATHPIX_API_KEY; a missing pair raises a clear RuntimeError. - Only needs `requests` (already a core dep), so the module imports without the llm extra. - Ported and cleaned up from conversion2025/converter.py on Summer2025: print/exit calls become exceptions, the PIL round-trip is dropped (bytes are streamed straight to disk), poll interval/count are parameters. Tests mock all HTTP. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017VXb8aZqgFBjoeuuddjW6r
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
in2lambda/wizard/mathpix.py:pdf_to_markdown()uploads a PDF to the Mathpix OCR API, polls for the rendered markdown, downloads any remote figures into<out_dir>/media/, and repoints the markdown at./media/<name>so the Markdown filter's image resolution finds them.$MATHPIX_APP_ID/$MATHPIX_API_KEY; a missing pair raises a clearRuntimeError.requests(already a core dep), so the module imports without thellmextra.conversion2025/converter.pyonSummer2025: print/exit calls become exceptions, the PIL round-trip is dropped (bytes stream straight to disk), poll interval/count are parameters.Stack: llm-client ← mathpix ← wizard-command
Base:
llm-client— #25.🤖 Generated with Claude Code