rework icons, codechanges, bugfixes, typofixes
This commit is contained in:
@@ -46,7 +46,7 @@ def tuple_to_dict(tlist: tuple, type: str) -> dict:
|
||||
ret = []
|
||||
for line in tlist:
|
||||
data = makeDict()
|
||||
if type == "Monographie":
|
||||
if type == "Monografien":
|
||||
data["type"] = type
|
||||
data["work_author"] = line[0]
|
||||
data["year"] = line[1]
|
||||
@@ -84,10 +84,10 @@ def tuple_to_dict(tlist: tuple, type: str) -> dict:
|
||||
|
||||
def elsa_word_to_csv(path):
|
||||
doc = Document(path)
|
||||
# print all lines in doc
|
||||
# # print all lines in doc
|
||||
doctype = [para.text for para in doc.paragraphs if para.text != ""][-1]
|
||||
tuples = {
|
||||
"Monographie": ("", "", "", "", "", "", "", "", ""),
|
||||
"Monografien": ("", "", "", "", "", "", "", "", ""),
|
||||
"Herausgeberwerke": ("", "", "", "", "", "", "", "", "", "", ""),
|
||||
"Zeitschriftenaufsätze": ("", "", "", "", "", "", "", "", "", ""),
|
||||
}
|
||||
@@ -113,10 +113,10 @@ def elsa_word_to_csv(path):
|
||||
data = [
|
||||
row for row in df.itertuples(index=False, name=None) if row != tuples[doctype]
|
||||
]
|
||||
print(data)
|
||||
# print(data)
|
||||
return tuple_to_dict(data, doctype), doctype
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
else_df = elsa_word_to_csv("c:/Users/aky547/Desktop/hrsgw_test.docx")
|
||||
print(else_df)
|
||||
else_df = elsa_word_to_csv("C:/Users/aky547/Desktop/Antrag ELSA Schweitzer.docx")
|
||||
# print(else_df)
|
||||
Reference in New Issue
Block a user