Script to update OCLC numbers in Alma records based on MARC merge files from OCLC's WorldShare Collection Manager
Searches Alma for records matching the OCNs found in the input file's 019 fields, then changes 035 (OCoLC) in any records found to the current OCN from the input file's 035 subfield a. Also changes any e-book unique identifiers in 035 fields with the prefix (ViHarT-EM) to use the new OCN. Output spreadsheet shows all matching records found on the first tab and all changes made on the second tab.
Created and tested with Python 3.7; see environment.yml
for complete requirements.
Requires an Alma Bibs API key with read/write permissions. A config file (local_settings.ini
) with this key should be located in the same directory as the script and input file. To switch between production and sandbox environments, provide both API keys in local_settings.ini
and comment out the appropriate lines 23/24 and 199/200 in the script.
Example of local_settings.ini
:
[Alma Production Bibs R/W]
key:apikey
[Alma Sandbox Bibs R/W]
key:apikey
python update_OCNs_ongoing.py input.mrc
where input.mrc
is a MARC merge file from OCLC's WorldShare Collection Manager, where each record has previous OCNs in the 019 field and the desired new OCN in 035 subfield a.
Rebecca B. French - https://github.com/frenchrb