Skip to content

Commit a849676

Browse files
committed
Update for ROR v2
1 parent 7b6ddef commit a849676

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

caltechdata_api/cli.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,14 @@ def get_funding_entries():
159159

160160
def validate_funder_identifier(funder_identifier):
161161
response = requests.get(f"https://api.ror.org/organizations/{funder_identifier}")
162+
returnv = False
162163
if response.status_code == 200:
163-
return response.json().get("name")
164-
else:
165-
return False
164+
names = response.json().get("names", [])
165+
for name in names:
166+
types = name.get("types", [])
167+
if "ror_display" in types:
168+
returnv = name.get("value")
169+
return returnv
166170

167171

168172
def get_funding_details():

0 commit comments

Comments
 (0)