scihub_tools¶
Retrieve the PDFs of DOIs via Sci-Hub.
The DOIs are read from a Zotero export in the Better BibTeX JSON format
(Export Items... -> Better BibTeX JSON), the PDFs are named by the citation
keys of the items.
dois_from_json
¶
Read the DOIs of a Better BibTeX JSON export of Zotero.
Items without a DOI are skipped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json_path
|
Path
|
path of the Better BibTeX JSON file. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
The DOIs by the citation keys of the items. |
scihub_pdf_from_doi
¶
Download the PDF of a DOI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doi
|
str
|
DOI of the publication, e.g., |
required |
pdf_path
|
Path
|
path the PDF is written to. |
required |
scihub_url
|
str | None
|
Sci-Hub domain to use; by default the best available domain
of scidownl, see |
None
|
scihub_pdfs_from_dois
¶
Download the PDFs of DOIs which are not in the directory yet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dois
|
dict[str, str]
|
DOIs by the keys the PDFs are named after, |
required |
pdf_dir
|
Path
|
directory of the PDFs, created if it does not exist. |
required |
scihub_url
|
str | None
|
Sci-Hub domain to use, see |
None
|
Returns:
| Type | Description |
|---|---|
list[str]
|
The keys for which no PDF exists after the download. |
scihub_pdfs
¶
Download the missing PDFs of a Better BibTeX JSON export of Zotero.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
zotero_json_path
|
Path
|
path of the Better BibTeX JSON file. |
required |
pdf_dir
|
Path | None
|
directory of the PDFs; by default the directory named after
the JSON file next to it, i.e., |
None
|
scihub_url
|
str | None
|
Sci-Hub domain to use, see |
None
|
Returns:
| Type | Description |
|---|---|
list[str]
|
The citation keys for which no PDF exists after the download. |
scihub_pdfs_command
¶
Command line interface scihub_pdfs, see scihub_pdfs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argv
|
Sequence[str] | None
|
command line arguments, by default |
None
|