Skip to content

Commit

Permalink
Added family name, credit name, and other names to record summary
Browse files Browse the repository at this point in the history
  • Loading branch information
skybristol committed Jan 21, 2024
1 parent b8b51e6 commit 1aeb637
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pyorcid/orcid.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def keywords(self):

def other_names(self):
'''
Other names by which the researcher is know
Other names by which the researcher is known
return :
'''
return self.__read_section("other-names")
Expand Down Expand Up @@ -396,7 +396,7 @@ def __are_keys_accessible(self,json_obj, keys):

return True

def __get_value_from_keys(self,json_obj, keys):
def __get_value_from_keys(self, json_obj, keys):
"""
Get the value associated with the last key in the list if all keys are accessible cumulatively.
Expand Down Expand Up @@ -459,6 +459,9 @@ def record_summary(self):
data = self.record()
extracted_data = {
'Name': self.__get_value_from_keys(data,["person","name","given-names","value"]),
'Family Name': self.__get_value_from_keys(data,["person","name","family-name","value"]),
'Credit Name': self.__get_value_from_keys(data,["person","name","credit-name","value"]),
'Other Names': [name['content'] for name in self.__get_value_from_keys(data,["person","other-names","other-name"])],
'Biography': self.__get_value_from_keys(data,["person","biography","content"]),
'Emails': [email['email'] for email in self.__get_value_from_keys(data,["person","emails","email"])],
'Research Tags (keywords)': [keyword['content'] for keyword in self.__get_value_from_keys(data,["person","keywords","keyword"])],
Expand Down

0 comments on commit 1aeb637

Please sign in to comment.