Skip to content

Commit

Permalink
Updated Elsevier author name handling (#91)
Browse files Browse the repository at this point in the history
* Delete tests/stubdata/output/Copernicus_ESSD_essd-15-3075-2023.json

* Delete tests/stubdata/output/Copernicus_GeChr_gchron-5-323-2023.json

* Delete tests/stubdata/output/Copernicus_ISPAn_isprs-annals-X-M-1-2023-237-2023.json

* Delete tests/stubdata/output/Copernicus_ISPAr_isprs-archives-XLVIII-M-2-2023-721-2023.json

* Delete tests/stubdata/input/Copernicus_ESSD_essd-15-3075-2023.xml

* Delete tests/stubdata/input/Copernicus_GeChr_gchron-5-323-2023.xml

* Delete tests/stubdata/input/Copernicus_ISPAn_isprs-annals-X-M-1-2023-237-2023.xml

* Delete tests/stubdata/input/Copernicus_ISPAr_isprs-archives-XLVIII-M-2-2023-721-2023.xml

* updated elsevier author name handling

---------

Co-authored-by: Mugdha Polimera <mugdhapolimera@saos-MacBook-Pro.local>
  • Loading branch information
mugdhapolimera and Mugdha Polimera committed Feb 15, 2024
1 parent 02c7ec6 commit 6473c3f
Show file tree
Hide file tree
Showing 12 changed files with 1,338 additions and 1,716 deletions.
8 changes: 6 additions & 2 deletions adsingestp/parsers/elsevier.py
Expand Up @@ -262,9 +262,13 @@ def _parse_authors(self):
authors_raw = self.record_meta.find("ce:author-group").find_all("ce:author")
for author in authors_raw:
author_tmp = {}
if author.find("ce:given-name") and author.find("ce:surname"):
author_tmp["given"] = author.find("ce:given-name").get_text()
if author.find("ce:surname"):
if author.find("ce:given-name"):
author_tmp["given"] = author.find("ce:given-name").get_text()
author_tmp["surname"] = author.find("ce:surname").get_text()
elif author.find("ce:given-name") and not author.find("ce:surname"):
# In case given-name is present, but no surname is available, put the given name in the surname
author_tmp["surname"] = author.find("ce:given-name")

author_tmp["orcid"] = author.get("orcid", "")

Expand Down
384 changes: 0 additions & 384 deletions tests/stubdata/input/Copernicus_ESSD_essd-15-3075-2023.xml

This file was deleted.

158 changes: 0 additions & 158 deletions tests/stubdata/input/Copernicus_GeChr_gchron-5-323-2023.xml

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 6473c3f

Please sign in to comment.