Skip to content

Commit 5c00ac1

Browse files
committed
Add teaching resource item type
1 parent 4455b9c commit 5c00ac1

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

caltech_authors_tech_report.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,21 @@ def epxml_to_datacite(eprint, customization=None):
8585
metadata["publicationYear"] = eprint["date"].split("-")[0]
8686
else:
8787
metadata["publicationYear"] = eprint["date"]
88-
metadata["types"] = {
89-
"resourceTypeGeneral": "Text",
90-
"resourceType": item_types[eprint["monograph_type"]],
91-
}
92-
88+
if "monograph_type" in eprint:
89+
metadata["types"] = {
90+
"resourceTypeGeneral": "Text",
91+
"resourceType": item_types[eprint["monograph_type"]],
92+
}
93+
elif eprint["type"] == "teaching_resource":
94+
metadata["types"] = {
95+
"resourceTypeGeneral": "Text",
96+
"resourceType": "Teaching Resource",
97+
}
98+
else:
99+
metadata["types"] = {
100+
"resourceTypeGeneral": "Text",
101+
"resourceType": "Text",
102+
}
93103
# Waterfall for determining series name and number
94104
if "abstract" in eprint:
95105
description = [

0 commit comments

Comments
 (0)