Skip to content

Commit e8d44f9

Browse files
committed
Add option to pass file info
1 parent 0472e0a commit e8d44f9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

caltechdata_api/decustomize_schema.py

Lines changed: 8 additions & 2 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):
5+
def decustomize_schema(json_record,pass_emails=False,pass_media=False):
66

77
#Extract subjects to single string
88
if "subjects" in json_record:
@@ -217,8 +217,14 @@ def decustomize_schema(json_record,pass_emails=False):
217217
if 'descriptionValue' in d:
218218
d["description"] = d.pop("descriptionValue")
219219

220+
#Handle file info
221+
if pass_media == False:
222+
if 'electronic_location_and_access' in json_record:
223+
del json_record['electonic_location_and_access']
224+
225+
220226
others = ['files', 'id', 'owners', 'pid_value', 'control_number', '_oai',
221-
'_form_uuid', 'electronic_location_and_access', 'access_right',
227+
'_form_uuid', 'access_right',
222228
'embargo_date','license','brief_authors','brief_information_bar',
223229
'brief_subtitle','brief_title','brief_summary','resource_type']
224230
for v in others:

0 commit comments

Comments
 (0)