Skip to content

Support Web of Science TBA dumps for PDF download - #3

Merged
MoonDavid merged 5 commits into
mainfrom
cursor/wos-tba-dump-support-c31f
Aug 6, 2026
Merged

Support Web of Science TBA dumps for PDF download#3
MoonDavid merged 5 commits into
mainfrom
cursor/wos-tba-dump-support-c31f

Conversation

@MoonDavid

Copy link
Copy Markdown
Owner

Summary

Adds support for Web of Science tab-delimited (TBA / savedrecs.txt) exports in save_pdf_from_dump, so you can download PDFs/XMLs directly from a WoS export without converting to .jsonl first.

Usage

In Web of Science: Export → Tab delimited / Tab-delimited (Win, UTF-8) (typically savedrecs.txt).

from paperscraper.pdf import save_pdf_from_dump

save_pdf_from_dump(
    "savedrecs.txt",
    pdf_path="wos_pdfs",
    key_to_save="doi",
    mail="you@example.com",
)

Optional conversion helper:

from paperscraper.utils import wos_tba_to_jsonl
wos_tba_to_jsonl("savedrecs.txt", "savedrecs.jsonl")

Field mapping

DIdoi, TItitle, AFauthors, ABabstract, PYdate, SOjournal, PMpubmed_id, UTwos_id

Also includes

This branch is based on the PDF pipeline fixes (bioc_pmc merge repair, ChemRxiv wiring, etc.) so dump downloads work end-to-end.

Verification

  • pytest paperscraper/tests/test_wos_tba.py → 6 passed
  • Demo on uploaded savedrecs(1).txt (100 records loaded; first 5 downloaded: 1 PDF, 2 XML, 2 abstract-only for paywalled)
Open in Web Open in Cursor 

cursoragent and others added 3 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>
Accept WoS tab-delimited UTF-8 exports (savedrecs.txt) alongside .jsonl
dumps. Adds load_wos_tba / load_papers_dump / wos_tba_to_jsonl helpers,
maps DI/TI/AF/AB/PY/SO/PM fields into paperscraper metadata, and documents
usage in the PDF retrieval examples.

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
cursoragent and others added 2 commits August 5, 2026 13:27
Resolve simple overlap conflict in save_pdf_from_dump skip-logic
(duplicate continue / key_to_save checks from both sides).

Co-authored-by: Davide Gotta <MoonDavid@users.noreply.github.com>
Live API retries can return fewer papers than the previous fixed
thresholds, which made CI flake on test_whole_researcher.

Co-authored-by: Davide Gotta <MoonDavid@users.noreply.github.com>
@MoonDavid
MoonDavid merged commit b21af5a into main Aug 6, 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