From 5c00ac1bec50b43c50c9fba0a1f6ac8054fbb5e2 Mon Sep 17 00:00:00 2001 From: Tom Morrell Date: Mon, 28 Sep 2020 05:57:57 -0700 Subject: [PATCH] Add teaching resource item type --- caltech_authors_tech_report.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/caltech_authors_tech_report.py b/caltech_authors_tech_report.py index a4a2e10..8773f77 100644 --- a/caltech_authors_tech_report.py +++ b/caltech_authors_tech_report.py @@ -85,11 +85,21 @@ def epxml_to_datacite(eprint, customization=None): metadata["publicationYear"] = eprint["date"].split("-")[0] else: metadata["publicationYear"] = eprint["date"] - metadata["types"] = { - "resourceTypeGeneral": "Text", - "resourceType": item_types[eprint["monograph_type"]], - } - + if "monograph_type" in eprint: + metadata["types"] = { + "resourceTypeGeneral": "Text", + "resourceType": item_types[eprint["monograph_type"]], + } + elif eprint["type"] == "teaching_resource": + metadata["types"] = { + "resourceTypeGeneral": "Text", + "resourceType": "Teaching Resource", + } + else: + metadata["types"] = { + "resourceTypeGeneral": "Text", + "resourceType": "Text", + } # Waterfall for determining series name and number if "abstract" in eprint: description = [