谷歌学者作者和引文的简单访问
scholarl的Python项目详细描述
学术
scholarly是一个模块,它允许您以友好的pythonic方式从Google Scholar检索作者和出版物信息。
用法
因为scholarly
不使用官方api,所以不需要密钥。简单:
importscholarlyprint(next(scholarly.search_author('Steven A. Cholewiak')))
方法
search_author
——按名称搜索作者并返回author对象的生成器。
>>>search_query=scholarly.search_author('Marty Banks, Berkeley')>>>print(next(search_query)){'_filled':False,'affiliation':'Professor of Vision Science, UC Berkeley','citedby':17758,'email':'@berkeley.edu','id':'Smr99uEAAAAJ','interests':['vision science','psychology','human factors','neuroscience'],'name':'Martin Banks','url_picture':'https://scholar.google.com/citations?view_op=medium_photo&user=Smr99uEAAAAJ'}
search_keyword
——按关键字搜索并返回author对象的生成器。
>>>search_query=scholarly.search_keyword('Haptics')>>>print(next(search_query)){'_filled':False,'affiliation':'Stanford University','citedby':31731,'email':'@cs.stanford.edu','id':'4arkOLcAAAAJ','interests':['Robotics','Haptics','Human Motion Understanding'],'name':'Oussama Khatib','url_picture':'https://scholar.google.com/citations?view_op=medium_photo&user=4arkOLcAAAAJ'}
search_pubs_query
——搜索文章/出版物和出版物对象的返回生成器。
>>>search_query=scholarly.search_pubs_query('Perception of physical stability and center of mass of 3D objects')>>>print(next(search_query)){'_filled':False,'bib':{'abstract':'Humans can judge from vision alone whether an object is ''physically stable or not. Such judgments allow observers ''to predict the physical behavior of objects, and hence ''to guide their motor actions. We investigated the visual ''estimation of physical stability of 3-D objects (shown ''in stereoscopically viewed rendered scenes) and how it ''relates to visual estimates of their center of mass ''(COM). In Experiment 1, observers viewed an object near ''the edge of a table and adjusted its tilt to the ''perceived critical angle, ie, the tilt angle at which ''the object …','author':'SA Cholewiak and RW Fleming and M Singh','eprint':'http://jov.arvojournals.org/article.aspx?articleid=2213254','title':'Perception of physical stability and center of mass of 3-D ''objects','url':'http://jov.arvojournals.org/article.aspx?articleid=2213254'},'citedby':14,'id_scholarcitedby':'15736880631888070187','source':'scholar','url_scholarbib':'https://scholar.googleusercontent.com/scholar.bib?q=info:K8ZpoI6hZNoJ:scholar.google.com/&output=citation&scisig=AAGBfm0AAAAAXGSbUf67ybEFA3NEyJzRusXRbR441api&scisf=4&ct=citation&cd=0&hl=en'}
示例
下面是一个简单的例子,演示如何检索作者的个人资料,然后检索引用他最受欢迎(被引用)论文的标题。
# Retrieve the author's data, fill-in, and printsearch_query=scholarly.search_author('Steven A Cholewiak')author=next(search_query).fill()print(author)# Print the titles of the author's publicationsprint([pub.bib['title']forpubinauthor.publications])# Take a closer look at the first publicationpub=author.publications[0].fill()print(pub)# Which papers cited that publication?print([citation.bib['title']forcitationinpub.get_citedby()])
安装
使用pip
从pypi安装:
pip install scholarly
或者pip
从github安装:
pip install git+https://github.com/OrganicIrradiation/scholarly.git
或者使用git克隆包:
git clone https://github.com/OrganicIrradiation/scholarly.git
要求
需要arrow、Beautiful Soup、bibtexparser和requests[security]。
许可证
这个项目的原始代码是由Bello Chalmers根据WTFPL许可证发布的。按照这种思路,所有代码都在Unlicense下发布。