Skip to content

Instantly share code, notes, and snippets.

@OriHoch
Created February 28, 2018 11:00
Show Gist options
  • Save OriHoch/fc65c93bfe2f583c7360496f7bd16828 to your computer and use it in GitHub Desktop.
Save OriHoch/fc65c93bfe2f583c7360496f7bd16828 to your computer and use it in GitHub Desktop.
getting data from union list of israel Z39.50 servers
#!/usr/bin/env bash
wget https://pypi.python.org/packages/6a/34/8176b841926a2add20524a9f74c307ac5fe6e33e9f4af12a58e6f7223982/mollyZ3950-2.04-molly1.tar.gz#md5=a0e5d7bb395ae31026afc7f974711630
sudo pip2 install ./mollyZ3950-2.04-molly1.tar.gz
sudo pip2 install pymarc
# see http://libnet.ac.il/~libnet/z39.htm
from PyZ3950 import zoom
import pymarc
conn = zoom.Connection('uli.nli.org.il', 9991)
# conn.databaseName = 'ULI02' # The Israel Union List (ULI)
conn.databaseName = 'NNL10' # National Library Name Authority File
conn.preferredRecordSyntax = 'USMARC'
conn.elementSetName='F'
for r in conn.search(zoom.Query('CCL', 'bibi')):
for record in pymarc.MARCReader(r.data):
print(record.title())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment