-
Notifications
You must be signed in to change notification settings - Fork 5
/
check_author.py
35 lines (29 loc) · 1.05 KB
/
check_author.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
#!/usr/bin/python3
import pickle
from statistics import median, mean
from datetime import date
import csv
import matplotlib.pyplot as plt
import sys
from pubs import Pub, Author, CONFERENCES, CONFERENCES_SHORT, AREA_TITLES
from top_authors import parse_authors
if __name__ == '__main__':
all_pubs = []
top_values = {}
if len(sys.argv) != 2:
print('Print all publications of an author. Call this script with {} "NAME"'.format(sys.argv[0]))
exit(1)
for area in CONFERENCES:
# Load pickeled data
with open('pickle/pubs-{}.pickle'.format(area), 'rb') as f:
pubs = pickle.load(f)
f.close()
all_pubs += pubs
print('# {}\'s publications in {}'.format(sys.argv[1], area))
auth_pubs, _, _ = parse_authors(pubs)
if sys.argv[1] not in auth_pubs:
continue
author = auth_pubs[sys.argv[1]]
for year in sorted(author.years):
for pub in author.pubs[year]:
print('{}, {}, {}'.format(pub.title, pub.venue, year))