Skip to content

Commit a4e60c2

Browse files
committed
fix: tweaks to datacite conversion
1 parent 8589b9e commit a4e60c2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

codemeticulous/datacite/convert.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,17 @@ def canonical_to_datacite(
345345
prefix=doi_prefix,
346346
suffix=doi_suffix,
347347
url=get_first_if_list(data.url),
348-
types=Types(resourceTypeGeneral="Software"),
348+
types=Types(
349+
resourceType=data.applicationCategory, resourceTypeGeneral="Software"
350+
),
349351
creators=codemeta_actors_to_datacite(data.author, Creator),
350352
titles=[Title(title=data.name)],
351353
publisher=get_first_if_list(
352354
codemeta_actors_to_datacite(data.publisher, Publisher)
353355
),
354356
publicationYear=str(data.datePublished.year) if data.datePublished else None,
355-
subjects=[Subject(subject=subject) for subject in ensure_list(data.keywords)],
357+
subjects=[Subject(subject=subject) for subject in ensure_list(data.keywords)]
358+
or None,
356359
contributors=codemeta_actors_to_datacite(data.contributor, Contributor),
357360
dates=[
358361
DateModel(
@@ -374,7 +377,7 @@ def canonical_to_datacite(
374377
formats=codemeta_language_fileformat_to_datacite_format(
375378
data.programmingLanguage, data.fileFormat
376379
),
377-
version=str(data.version),
380+
version=str(data.version) if data.version else None,
378381
rightsList=codemeta_license_to_datacite_rights(data.license),
379382
descriptions=descriptions,
380383
# codemeta.funding is a plain string, can't really ensure that the string

0 commit comments

Comments
 (0)