一个基于SciHub和googlescholar的软件包,可以下载给定DOI、网址或关键字的文章。
getarticle-dev的Python项目详细描述
获取文章
说明
getarticle
是一个基于SciHub和Google Scholar的包,可以下载给定DOI、网站地址或关键字的文章。在
安装
使用pip
安装:
# for latest version (recommended)
pip install git+https://github.com/HTian1997/getarticle.git
# for last release
pip install getarticle
功能和用法
getarticle
可以在Python中导入或用作命令行。在
要在命令行中使用的:
^{pr2}$示例:
getarticle -i 10.1126/science.abc7424 -o /Users/haotian/Desktop
下载方向默认为终端的当前方向。要更改默认下载方向,请使用-sd
选项。在
示例:
getarticle -sd /Users/haotian/Downloads
# will download to /Users/haotian/Downloads folder
getarticle -i 10.1126/science.abc7424
getarticle
也可以下载当前网页的文章(仅MacOS Safari支持)。在
示例:
# current Safari webpage:
# https://www.nature.com/articles/s41467-020-16670-2
# download article of current webpage to default direction
getarticle
要在Python中使用的:
- 初始化
fromgetarticleimportGetArticlega=GetArticle()
- 下载一篇给定DOI或网站地址的文章。在
ga.input_article("10.1126/science.abc7424")ga.download()
注意事项:
- 一旦下载,所有存储的文章将被清除
- 对于
download
函数,direction
参数默认为当前方向 - 下载的文章被命名为“文章标题.pdf“如果成功或”年-月-日-时-分-第二.pdf". 在
- 下载多篇文章。在
ga.input_article("https://www.nature.com/articles/s41594-020-0468-7#article-info")ga.input_article("10.1038/s41893-020-0581-y")ga.download()
注意事项:
- 重复使用
article
函数可以保存多篇文章。在 getarticle
不会保存和下载重复文章
- 下载相关文章给定关键字。关键词可以是文章名、研究领域或作者名。(此功能正在开发中。)
ga.search("Deep Dive into Machine Learning Models for Protein Engineering")ga.search("SARS, Computation",num_of_page=2)ga.search("Roberta Croce")ga.download()
注意事项:
num_of_page
是Google Scholar中相应的页数。在num_of_page
默认为1。在
- 显示当前存储的文章/按索引删除文章。在
ga.cur_articles()ga.remove_article()
许可证
麻省理工学院
- 项目
标签: