Skip to content

Fix PDF-from-dump pipeline and fallbacks - #2

Merged
MoonDavid merged 2 commits into
mainfrom
cursor/fix-pdf-fallbacks-c31f
Aug 5, 2026
Merged

Fix PDF-from-dump pipeline and fallbacks#2
MoonDavid merged 2 commits into
mainfrom
cursor/fix-pdf-fallbacks-c31f

Conversation

@MoonDavid

Copy link
Copy Markdown
Owner

Summary

Repairs the broken PDF download path so save_pdf / save_pdf_from_dump work again, and closes related gaps in the existing fallback stack.

Fixes

  • fallback_bioc_pmc: restore after a bad merge that left a SyntaxError (blocked importing paperscraper.pdf entirely). Re-adds NCBIRateLimitError, PMCID assignment, retries, and ncbi_email support.
  • medrxiv_s3: add missing as_completed / tqdm imports.
  • load_api_keys: load SPRINGER_API_KEY.
  • ChemRxiv: wire existing Open Engage API helpers into save_pdf (HTML scraping is Cloudflare-blocked).
  • save_pdf_from_dump: validate key_to_save (doi/title/date), create output dir, skip papers missing the filename key.
  • Tests: align Elsevier mock with header-based X-ELS-APIKey auth.

Verification

  • Module imports cleanly.
  • Lint: ruff + isort on touched paths.
  • PDF tests + live hello-world dump download (in progress / to follow in CI).
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 5, 2026 12:32
Restore a working fallback_bioc_pmc after a bad merge (syntax error that
blocked importing paperscraper.pdf), re-add NCBIRateLimitError, fix
missing as_completed/tqdm imports for medRxiv S3, load SPRINGER_API_KEY,
and wire ChemRxiv Open Engage helpers into save_pdf. Also validate
key_to_save and align the Elsevier mock test with header-based auth.

Co-authored-by: Davide Gotta <MoonDavid@users.noreply.github.com>
- Guard bioRxiv/medRxiv S3 when AWS keys are missing
- Recognize 10.1101 DOIs for preprint S3 fallbacks
- Validate PDF bytes before opening files (fixes empty leftovers under mocks)
- Skip S3 sections in tests without AWS credentials
- Update paywalled-chapter expectation now that arXiv fallback can succeed

Co-authored-by: Davide Gotta <MoonDavid@users.noreply.github.com>
@MoonDavid
MoonDavid marked this pull request as ready for review August 5, 2026 13:26
@MoonDavid
MoonDavid merged commit cf1263f into main Aug 5, 2026
2 of 4 checks passed
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