@@ -140,7 +140,7 @@ def get_funding_entries():
140
140
def validate_funder_identifier (funder_identifier ):
141
141
response = requests .get (f"https://api.ror.org/organizations/{ funder_identifier } " )
142
142
if response .status_code == 200 :
143
- return True
143
+ return response . json (). get ( "name" )
144
144
else :
145
145
return False
146
146
@@ -157,7 +157,8 @@ def get_funding_details():
157
157
award_title = get_user_input ("Enter the award title for funding: " )
158
158
while True :
159
159
funder_identifier = get_user_input ("Enter the funder ROR (https://ror.org): " )
160
- if validate_funder_identifier (funder_identifier ):
160
+ name = validate_funder_identifier (funder_identifier )
161
+ if name :
161
162
break
162
163
else :
163
164
print (
@@ -169,6 +170,7 @@ def get_funding_details():
169
170
return {
170
171
"awardNumber" : award_number ,
171
172
"awardTitle" : award_title ,
173
+ "funderName" : name ,
172
174
"funderIdentifier" : funder_identifier ,
173
175
"funderIdentifierType" : "ROR" ,
174
176
}
@@ -194,9 +196,18 @@ def parse_arguments():
194
196
if license_number .isdigit () and 1 <= int (license_number ) <= 8 :
195
197
# Valid license number selected
196
198
args ["license" ] = {
197
- "1" : "cc0-1.0" ,
198
- "2" : "cc-by-4.0" ,
199
- "3" : "cc-by-nc-4.0" ,
199
+ "1" : {
200
+ "rights" : "Creative Commons Zero v1.0 Universal" ,
201
+ "rightsIdentifier" : "cc0-1.0" ,
202
+ },
203
+ "2" : {
204
+ "rights" : "Creative Commons Attribution v4.0 Universal" ,
205
+ "rightsIdentifier" : "cc-by-4.0" ,
206
+ },
207
+ "3" : {
208
+ "rights" : "Creative Commons Attribution Non-Commercial v4.0 Universal" ,
209
+ "rightsIdentifier" : "cc-by-nc-4.0" ,
210
+ },
200
211
}[license_number ]
201
212
break
202
213
else :
@@ -259,9 +270,11 @@ def get_names(orcid):
259
270
return family_name , given_name
260
271
261
272
262
- def write_s3cmd_config (access_key , secret_key , endpoint ):
273
+ def write_s3cmd_config (endpoint ):
263
274
configf = os .path .join (home_directory , ".s3cfg" )
264
275
if not os .path .exists (configf ):
276
+ access_key = get_user_input ("Enter the access key: " )
277
+ secret_key = get_user_input ("Enter the secret key: " )
265
278
with open (configf , "w" ) as file :
266
279
file .write (
267
280
f"""[default]
@@ -286,9 +299,7 @@ def upload_supporting_file(record_id=None):
286
299
endpoint = "sdsc.osn.xsede.org"
287
300
path = "ini230004-bucket01/"
288
301
if not record_id :
289
- access_key = get_user_input ("Enter the access key: " )
290
- secret_key = get_user_input ("Enter the secret key: " )
291
- write_s3cmd_config (access_key , secret_key , endpoint )
302
+ write_s3cmd_config (endpoint )
292
303
print ("""S3 connection configured.""" )
293
304
break
294
305
endpoint = f"https://{ endpoint } /"
@@ -478,9 +489,7 @@ def create_record(production):
478
489
],
479
490
"types" : {"resourceType" : "" , "resourceTypeGeneral" : "Dataset" },
480
491
"rightsList" : [
481
- {
482
- "rightsIdentifier" : args ["license" ],
483
- }
492
+ args ["license" ],
484
493
],
485
494
"fundingReferences" : args ["fundingReferences" ],
486
495
"schemaVersion" : "http://datacite.org/schema/kernel-4" ,
0 commit comments