Skip to content

Commit 2b5f5bb

Browse files
committed
ilri/crossref_doi_lookup.py: get language
1 parent fd3ff89 commit 2b5f5bb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ilri/crossref_doi_lookup.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
#
3-
# crossref-doi-lookup.py 0.2.1
3+
# crossref-doi-lookup.py 0.2.2
44
#
55
# Copyright Alan Orth.
66
#
@@ -203,6 +203,12 @@ def resolve_doi(doi: str) -> None:
203203
except KeyError:
204204
abstract = ""
205205

206+
# Get the language if it exists
207+
try:
208+
language = data["message"]["language"]
209+
except KeyError:
210+
language = ""
211+
206212
try:
207213
journal = data["message"]["container-title"][0]
208214
except IndexError:
@@ -324,6 +330,7 @@ def resolve_doi(doi: str) -> None:
324330
{
325331
"title": title,
326332
"abstract": abstract,
333+
"language": language,
327334
"authors": "||".join(authors),
328335
"affiliations": "||".join(affiliations),
329336
"funders": "||".join(funders),
@@ -409,6 +416,7 @@ def signal_handler(signal, frame):
409416
fieldnames = [
410417
"title",
411418
"abstract",
419+
"language",
412420
"authors",
413421
"affiliations",
414422
"funders",

0 commit comments

Comments
 (0)