-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtasks.py
More file actions
49 lines (39 loc) · 1.21 KB
/
tasks.py
File metadata and controls
49 lines (39 loc) · 1.21 KB
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
40
41
42
43
44
45
46
47
48
49
import re
from pymongo.collection import Collection
from ui import *
from subtasks.search_for_articles import search_for_articles
from subtasks.search_for_author import search_for_authors
from subtasks.add_an_article import add_an_article
def list_the_venues(dblp: Collection):
# check for inut number n
while True:
try:
topN = int(input("Please provide top number: "))
if topN <= 0:
raise ValueError
break
except ValueError:
print("Invalid top number.")
result = dblp.find({})
print("==================== Venues ====================")
index = 1
for venue in result:
if venue["_id"] is None or venue["_id"] == "":
continue
print(str(index) + ".")
print(" " + "venue: " + venue["_id"])
print(" " + "article count: " + str(venue["article_count"]))
print(" " + "citation count: " +
str(venue["referenced_by_count"]))
if index == topN:
break
else:
index += 1
return
task_dict = {
"1": search_for_articles,
"2": search_for_authors,
"3": list_the_venues,
"4": add_an_article,
"5": None
}