Skip to main content

Paper Fetcher

@vcjdeboer/paper-fetcherv2026.10.31.3· 1d agoBEHAVIORSACCEPTED WARNINGS
01README

Resolve DOIs (OpenAlex, Crossref), download paper PDFs from open-access sources or publisher pages with a provenance record, identify which paper a local PDF is, and extract text from PDFs.

02Release Notes

Docs: the OpenAlex API key is vault-only (swamp refuses plain text); vault setup and swamp doctor secrets explained. No behaviour changes.

03Behaviors1
@vcjdeboer/paper-fetcherv2026.10.31.3paper_fetcher.ts

Global Arguments

ArgumentTypeDescription
papersDir?stringFolder where fetch saves PDFs and their <doi>.json provenance records
openalexApiKey?stringOptional OpenAlex API key; store it in a vault and reference it
fn resolve(doi: string)
Look up a DOI in OpenAlex and Crossref: title, year, journal, authors,
ArgumentTypeDescription
doistringDOI as 10.x/y, doi:10.x/y or https://doi.org/10.x/y
fn identify(path: string)
Work out which paper a local PDF is: the DOI printed on its first pages
ArgumentTypeDescription
pathstringPath to a local .pdf file
fn fetch(doi: string, overwrite?: boolean)
Download the PDF for a DOI into papersDir as <doi>.pdf with a <doi>.json
ArgumentTypeDescription
doistringDOI as 10.x/y, doi:10.x/y or https://doi.org/10.x/y
overwrite?booleanDownload again even if a valid PDF is already in papersDir
fn pdfToText(path: string, maxChars?: number, offset?: number, saveTxt?: boolean)
Extract plain text from a local PDF (pdftotext if installed, otherwise the
ArgumentTypeDescription
pathstringPath to a local .pdf file
maxChars?numberMaximum characters returned in this chunk
offset?numberStart of the chunk; use next_offset from the previous call
saveTxt?booleanAlso write the full text as <name>.txt next to the PDF (replaces an existing one)

Resources

work(infinite)— Metadata and open-access status for a DOI
identification(infinite)— Which paper (DOI) a local PDF is, and how sure that is
download(infinite)— Outcome and provenance of a PDF download for a DOI
pdfText(infinite)— A chunk of text extracted from a local PDF
04Previous Versions2
2026.10.31.2

Fix: model and methods now listed on the registry page (metadata is read from source text). No behaviour changes.

Added 1 behaviors

2026.10.31.1

First release: resolve (OpenAlex/Crossref), identify (PDF -> DOI), fetch (open access and publisher PDFs with provenance), pdfToText.

05Stats
A
93 / 100
Downloads
0
Archive size
513.7 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License1/2partial

    no SPDX license declared

  • Verified public repository2/2earned

07Platforms
08Labels