mosaic import
Moves PDFs you downloaded yourself into the library, named and recorded in the cache as if mosaic get had downloaded them.
Usage
bash
mosaic import ~/Downloads/1-s2.0-S0094576517312663-main.pdf # DOI found in the file
mosaic import ~/Downloads/*.pdf --download-dir ~/papers/project
mosaic import scan.pdf --doi 10.1016/j.paerosci.2006.01.001 # DOI given
mosaic import paper.pdf --force # replace a PDF with the same nameBehaviour
The DOI is taken from --doi (one file only), or found in the file, in this order:
- the document's own DOI in the PDF metadata (XMP or the Info dictionary), anywhere in the file;
- the PII in a ScienceDirect file name,
1-s2.0-<PII>-main.pdf, looked up on Crossref; - a DOI in the first 2 MB of the content, only when exactly one distinct DOI appears (a reference list cites many).
Title, authors and year come from the cache or Crossref. The file is copied to the library and the original deleted; a file Windows keeps locked is left in place, with a note. A file that is not a PDF is rejected and left alone. A different PDF already filed under the same name is not replaced without --force.
Exit code 1 if any file could not be imported.
See also: tutorial 5, paywalls recipes.
Options
mosaic import [OPTIONS] FILES...| Argument | Value | Description |
|---|---|---|
FILES | PATH | PDF file(s) to file into the library |
| Option | Value | Default | Description |
|---|---|---|---|
--doi | TEXT | DOI of the paper (only with a single file; default: detect) | |
--download-dir | TEXT | Library folder (default: config download_dir) | |
--force | Replace a PDF already filed under the same name |

