|
@ -17,12 +17,15 @@ def getpublications(): |
|
|
csv_as_dict = csv.DictReader(libcsv) |
|
|
csv_as_dict = csv.DictReader(libcsv) |
|
|
publications = {} |
|
|
publications = {} |
|
|
for row in csv_as_dict: |
|
|
for row in csv_as_dict: |
|
|
pubinfo = {"Title" : row["Publication"], |
|
|
pubinfo = { |
|
|
"Author" : row["Author"], |
|
|
"Title": row["Publication"], |
|
|
"Type" : row["Type"]} |
|
|
"Author": row["Author"], |
|
|
|
|
|
"Type": row["Type"], |
|
|
|
|
|
} |
|
|
publications[row["Id"]] = pubinfo |
|
|
publications[row["Id"]] = pubinfo |
|
|
return publications |
|
|
return publications |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def gettypes(): |
|
|
def gettypes(): |
|
|
libcsv = open(os.path.join(script_dir, "varlib.csv"), "r") |
|
|
libcsv = open(os.path.join(script_dir, "varlib.csv"), "r") |
|
|
with libcsv: |
|
|
with libcsv: |
|
@ -32,9 +35,20 @@ def gettypes(): |
|
|
lowertype = row["Type"].lower() |
|
|
lowertype = row["Type"].lower() |
|
|
if lowertype not in listoftypes: |
|
|
if lowertype not in listoftypes: |
|
|
listoftypes.append(lowertype) |
|
|
listoftypes.append(lowertype) |
|
|
#listoftypes = [t.title() for t in listoftypes] |
|
|
|
|
|
return listoftypes |
|
|
return listoftypes |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getyears(): |
|
|
|
|
|
libcsv = open(os.path.join(script_dir, "varlib.csv"), "r") |
|
|
|
|
|
with libcsv: |
|
|
|
|
|
csv_as_dict = csv.DictReader(libcsv) |
|
|
|
|
|
listofyears = [] |
|
|
|
|
|
for row in csv_as_dict: |
|
|
|
|
|
if row["Year"] not in listofyears: |
|
|
|
|
|
listofyears.append(row["Year"]) |
|
|
|
|
|
return listofyears |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# test = getpublications() |
|
|
# test = getpublications() |
|
|
# for ids, pubinfo in test.items(): |
|
|
# for ids, pubinfo in test.items(): |
|
|
# print(pubinfo["Title"]) |
|
|
# print(pubinfo["Title"]) |
|
|