Skip to content

Commit

Permalink
Merge pull request #23 from dag-hammarskjold-library/jb/20
Browse files Browse the repository at this point in the history
Delete all instances of tag for delete field operation
  • Loading branch information
jbukhari authored Jan 14, 2025
2 parents b860737 + c458541 commit 03a209d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions batch_edits/scripts/batch_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,31 +123,31 @@ def edit_3(bib):
# delete_field
def edit_4(bib):
# 4. BIBLIOGRAPHIC, SPEECHES, VOTING - Delete field 000 - No condition
bib.delete_field('000')
bib.delete_fields('000')
return bib

# delete_field
def edit_5(bib):
# 5. BIBLIOGRAPHIC - Delete field 008 - No condition
# update: delete for all record types

bib.delete_field('008')
bib.delete_fields('008')

return bib

# delete_field
def edit_6(bib):
# 6. BIBLIOGRAPHIC, VOTING - Delete field 035 - IF 089__b is NOT B22 (keep 035 for speeches)
if not any([x == 'Speeches' for x in bib.get_values('989', 'a')]):
bib.delete_field('035')
bib.delete_fields('035')

return bib

# delete_field
def edit_7(bib):
# 7. BIBLIOGRAPHIC - Delete field 069 - No condition
if not any([x == 'Speeches' or x == 'Voting Data' for x in bib.get_values('989', 'a')]):
bib.delete_field('069')
bib.delete_fields('069')

return bib

Expand Down Expand Up @@ -191,15 +191,15 @@ def edit_11(bib):
def edit_12(bib):
# 12. BIBLIOGRAPHIC - Delete field 222 - No condition
if not any([x == 'Speeches' or x == 'Voting Data' for x in bib.get_values('989', 'a')]):
bib.delete_field('222')
bib.delete_fields('222')

return bib

# delete_field
def edit_13(bib):
# 13. VOTING, SPEECHES - Delete field 269 - If (089:B22 OR 089:B23) - Only speeches and votes
if any([x == 'Speeches' or x == 'Voting Data' for x in bib.get_values('989', 'a')]):
bib.delete_field('269')
bib.delete_fields('269')

return bib

Expand Down Expand Up @@ -239,47 +239,47 @@ def edit_16(bib):
def edit_17(bib):
# 17. BIBLIOGRAPHIC - Delete field 773 - No condition
if not any([x == 'Speeches' or x == 'Voting Data' for x in bib.get_values('989', 'a')]):
bib.delete_field('773')
bib.delete_fields('773')

return bib

# delete_field
def edit_18(bib):
# 18. BIBLIOGRAPHIC - Delete field 910 - No conditions
if not any([x == 'Speeches' or x == 'Voting Data' for x in bib.get_values('989', 'a')]):
bib.delete_field('910')
bib.delete_fields('910')

return bib

# delete_field
def edit_19(bib):
# 19. BIBLIOGRAPHIC - Delete field 920 - No condition
if not any([x == 'Speeches' or x == 'Voting Data' for x in bib.get_values('989', 'a')]):
bib.delete_field('920')
bib.delete_fields('920')

return bib

# delete_field
def edit_20(bib):
# 20. BIBLIOGRAPHIC - Delete field 949 - TO COMPLETE AFTER DECISION
# update: go ahead
bib.delete_field('949')
bib.delete_fields('949')

return bib

# delete_field
def edit_21(bib):
# 21. BIBLIOGRAPHIC - Delete field 955 - No condition
if not any([x == 'Speeches' or x == 'Voting Data' for x in bib.get_values('989', 'a')]):
bib.delete_field('955')
bib.delete_fields('955')

return bib

# delete_field
def edit_22(bib):
# 22. BIBLIOGRAPHIC - Delete field 995 - No condition
if not any([x == 'Speeches' or x == 'Voting Data' for x in bib.get_values('989', 'a')]):
bib.delete_field('995')
bib.delete_fields('995')

return bib

Expand Down

0 comments on commit 03a209d

Please sign in to comment.