Skip to content

Commit

Permalink
fix(export): Filtered author export based on Country
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Vagliano
  • Loading branch information
Lorenzovagliano committed Nov 13, 2024
1 parent 236aa07 commit 6f2be7c
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions scoap3/utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,24 +134,22 @@ def author_export(search_year, search_country):
author_last_name = author.get("last_name", "UNKNOWN")
# add extracted information to result list
for affiliation in author.affiliations:
if not affiliation.country:
aff_country = "UNKNOWN"
else:
if affiliation.country.code == search_country:
aff_country = affiliation.country.code
aff_value = affiliation.get("value", "UNKNOWN")
result_data.append(
[
year,
journal,
doi,
arxiv,
arxiv_category,
author_first_name + " " + author_last_name,
aff_country,
aff_value,
total_authors,
]
)
aff_value = affiliation.get("value", "UNKNOWN")
result_data.append(
[
year,
journal,
doi,
arxiv,
arxiv_category,
author_first_name + " " + author_last_name,
aff_country,
aff_value,
total_authors,
]
)

if missing_author_affiliations:
logger.warn(
Expand Down

0 comments on commit 6f2be7c

Please sign in to comment.