Paper Fetcher
@vcjdeboer/paper-fetcherv2026.10.31.3
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.
03Behaviors
@vcjdeboer/paper-fetcherv2026.10.31.3paper_fetcher.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| papersDir? | string | Folder where fetch saves PDFs and their <doi>.json provenance records |
| openalexApiKey? | string | Optional 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,
| Argument | Type | Description |
|---|---|---|
| doi | string | DOI 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
| Argument | Type | Description |
|---|---|---|
| path | string | Path 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
| Argument | Type | Description |
|---|---|---|
| doi | string | DOI as 10.x/y, doi:10.x/y or https://doi.org/10.x/y |
| overwrite? | boolean | Download 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
| Argument | Type | Description |
|---|---|---|
| path | string | Path to a local .pdf file |
| maxChars? | number | Maximum characters returned in this chunk |
| offset? | number | Start of the chunk; use next_offset from the previous call |
| saveTxt? | boolean | Also 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 Versions
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
deno-command1 accepted
Spawns a subprocess with Deno.Command().
- models/paper_fetcher/pdftext.ts:48 — optional poppler pdftotext, documented in README
07Platforms
08Labels