Skip to content

Instantly share code, notes, and snippets.

@edsu
Last active March 27, 2019 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edsu/398ad8c9fbee51735166e829cda40989 to your computer and use it in GitHub Desktop.
Save edsu/398ad8c9fbee51735166e829cda40989 to your computer and use it in GitHub Desktop.
Reading a string containing MARCXML with pymarc.
from pymarc.marcxml import parse_xml_to_array
from io import StringIO
xml_text = open('test/batch.xml').read()
xml = StringIO(xml_text)
records = parse_xml_to_array(xml)
print(records)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment