From af1d58396db79668e00acc67a2ee498f40e1e094 Mon Sep 17 00:00:00 2001 From: Georg Date: Thu, 5 Mar 2020 08:11:50 +0100 Subject: [PATCH] harvest ABO --- README.md | 6 +++++- harvest_abo_marc.py | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 harvest_abo_marc.py diff --git a/README.md b/README.md index c4620b8..e8dbb0e 100644 --- a/README.md +++ b/README.md @@ -27,4 +27,8 @@ queried. ## [OAI-PMH](OAI-PMH.ipynb) We show how to use [Sickle](https://sickle.readthedocs.io/en/latest/) to first list all available sets and then count -the number of entries in one specific set. \ No newline at end of file +the number of entries in one specific set. + +## [Harvest ABO Marc](harvest_abo_marc.py) + +Small script to harvest ABO metadata in Marc format via OAI-PMH. \ No newline at end of file diff --git a/harvest_abo_marc.py b/harvest_abo_marc.py new file mode 100644 index 0000000..cc3b796 --- /dev/null +++ b/harvest_abo_marc.py @@ -0,0 +1,10 @@ +from sickle import Sickle + +sickle = Sickle('https://eu02.alma.exlibrisgroup.com/view/oai/43ACC_ONB/request') +records = sickle.ListRecords(metadataPrefix='marc21', set='ABOMARC') +counter = 0 +for record in records: + counter = counter + 1 + print(counter) + with open('marc/' + str(counter) + '.xml', 'w') as fp: + fp.write(record.raw) \ No newline at end of file -- GitLab