-
Notifications
You must be signed in to change notification settings - Fork 44
/
simple.py
34 lines (27 loc) · 1.02 KB
/
simple.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: utf-8 -*-
from scidownl import scihub_download
def download_one_paper():
"""Example of downloading one paper.
The paper will be downloaded the ./paper/ directory, and
the filename is one_paper.pdf
"""
paper = "https://doi.org/10.1145/3375633"
paper_type = "doi"
out = "./paper/one_paper.pdf"
scihub_download(paper, paper_type=paper_type, out=out)
def download_multi_papers():
"""Example of downloading multiple papers.
All papers will be downloaded to the ./paper/ directory,
and their filenames are the paper titles.
"""
source = [
("https://doi.org/10.1145/3375633", 'doi', "./paper/"),
("31395057", 'pmid', "./paper/"),
("24686414", 'pmid', "./paper/"),
("Aggregated Residual Transformations for Deep Neural Networks", 'title', "./paper/"),
]
for paper, paper_type, out in source:
scihub_download(paper, paper_type=paper_type, out=out)
if __name__ == '__main__':
download_one_paper()
download_multi_papers()