Skip to content

Commit e299763

Browse files
committed
Add option to pass owner information
1 parent 0505240 commit e299763

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

caltechdata_api/decustomize_schema.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import json
33
import argparse
44

5-
def decustomize_schema(json_record,pass_emails=False,pass_media=False):
5+
def decustomize_schema(json_record,pass_emails=False,pass_media=False,pass_owner=False):
66

77
#Extract subjects to single string
88
if "subjects" in json_record:
@@ -234,11 +234,12 @@ def decustomize_schema(json_record,pass_emails=False,pass_media=False):
234234
if 'electronic_location_and_access' in json_record:
235235
del json_record['electronic_location_and_access']
236236

237-
238-
others = ['files', 'id', 'owners', 'pid_value', 'control_number', '_oai',
237+
others = ['files', 'id', 'pid_value', 'control_number', '_oai',
239238
'_form_uuid', 'access_right',
240239
'embargo_date','license','brief_authors','brief_information_bar',
241240
'brief_subtitle','brief_title','brief_summary','resource_type']
241+
if pass_owner == False:
242+
other.append('owners')
242243
for v in others:
243244
if v in json_record:
244245
del json_record[v]

0 commit comments

Comments
 (0)