-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.py
39 lines (32 loc) · 1.49 KB
/
search.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
35
36
37
38
39
import datetime
import pandas as pd
from pybliometrics.scopus import AbstractRetrieval
from pybliometrics.scopus import AuthorRetrieval
from pybliometrics.scopus.utils import config
print(config['Authentication']['APIKey'])
print(config['Directories']['AbstractRetrieval'])
df = pd.DataFrame(columns=['year','owner','title','abstract','keywords','source','type','doi','eid','bibtex','html'])
authors ={
"Carmine Spagnuolo" : '55757507300',
"Gennaro Cordasco" : '57193482076',
"Vittorio Scarano" : '7004638056',
"Delfina Malandrino" : '7801383595',
"Biagio Cosenza" : '26029283100',
"Maria Angela Pellegrino": '57204732130'}
p_index = 0
for author in authors:
sauthor = AuthorRetrieval(authors[author])
documents = sauthor.get_documents()
print("Author: ",author," - ",len(documents)," documents")
for doc in documents:
bib = AbstractRetrieval(doc.eid, view="FULL")
bibtex = ''
if(bib != None and bib.aggregationType == 'Journal'):
bibtex = bib.get_bibtex()
df.loc[p_index] = [doc.coverDate, author, doc.title, doc.description, doc.authkeywords,doc.publicationName,bib.aggregationType, 'https://www.doi.org/'+str(doc.doi), doc.eid, bibtex,bib.get_html()]
p_index+=1
df = df.sort_values(by=['year'],ascending=False)
df = df.drop_duplicates(subset=['eid'], keep='first')
file_name = datetime.datetime.now().strftime('publications')
df.to_csv('data/'+file_name+'.csv',index=False)
df.to_json('data/'+file_name+'.json',orient='split', index=False)