generated from yaoyao-liu/minimal-light
-
Notifications
You must be signed in to change notification settings - Fork 62
/
main.py
23 lines (21 loc) · 785 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from scholarly import scholarly
import jsonpickle
import json
from datetime import datetime
import os
author: dict = scholarly.search_author_id('Uf9GqRsAAAAJ')
scholarly.fill(author, sections=['basics', 'indices', 'counts', 'publications'])
name = author['name']
author['updated'] = str(datetime.now())
author['publications'] = {v['author_pub_id']:v for v in author['publications']}
print(json.dumps(author, indent=2))
os.makedirs('results', exist_ok=True)
with open(f'results/gs_data.json', 'w') as outfile:
json.dump(author, outfile, ensure_ascii=False)
shieldio_data = {
"schemaVersion": 1,
"label": "citations",
"message": f"{author['citedby']}",
}
with open(f'results/gs_data_shieldsio.json', 'w') as outfile:
json.dump(shieldio_data, outfile, ensure_ascii=False)