Library - unsorted

From Helpful
Jump to: navigation, search
This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)


Semi-sorted

On what various common identifiers really are, and what that means to mapping between them

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)




MARC field 035 (Local System Number) will often store a (bracketed) string identifier to disambiguate the type of identifier stored there, including:

You might for example see 035 $a(OCoLC)ocm69983298


When OCLC numbers are used in the MARC field 001(verify), they are prefixed using:

  • ocm for eight-digit numbers (≤99999999)
  • ocn for nine-digit numbers (≥100000000)


PyZ3950

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

Installation

You need the python PLY package or you will get ImportError: No module named lex. Also as of this writing, ubuntu's python-ply package seems to be broken, but since the modules are pure python, manually unpacking lex.py and yacc.py from the download (into the z3950 directory in your site-packages, for example) also works.

The 2.04 tarball has a bug in the install scripts that causes it to raise:

AttributeError: 'float' object has no attribute 'replace'

This seems to mean the version in vers.py should be a string, not a float.


Docs & notes


How to deal with slow/timeouting connects?


Documentation example:

from PyZ3950 import zoom
conn = zoom.Connection('z3950.loc.gov', 7090)
conn.databaseName          = 'VOYAGER'
conn.preferredRecordSyntax = 'USMARC'
 
# for exxample with CCL (there are other options)
query = zoom.Query('CCL', 'ti="this and that"')
results = conn.search(query)
 
for result in results:
    print result
 
conn.close()