| |
- exceptions.Exception
-
- MarcError
- MARC
- MARC8_to_Unicode
class MARC |
|
Parses data into 'fields' attribute, indexed by field number.
Each value is a list. For fixed fields, it's a list of the string data
(one string for each occurence of the field in the original data). For
other fields, each list element is a tuple of (indicator 1, indicator 2,
subdata), where subdata is a list of tuples of (subfield indicator,
subfield data). Yes, this is kinda lame and I really should have
used structures, but this was some of the first Python code I ever
wrote. |
|
Methods defined here:
- __init__(self, MARC=None, strict=1)
- Parses MARC data. According to Bill Oldroyd (Bill.Oldroyd at
bl.uk), some servers don't set the character set and/or other
bits of the MARC header properly, so it's useful to set strict=0
when dealing with such servers.
- __str__(self)
- extract_int(self, start, end)
- get_MARC(self)
- sgml_processCode(self, k)
- stringify_field(self, k)
- toMARCXML(self)
- Convert record to MarcXML Schema
- toMODS(self)
- Tranform MARC record into MODS according to CrossWalk
- toOAIMARC(self)
- Convert record to OAI MARC XML Schema.
Note Well that OAI-MHP 2.0 recommends using MarcXML
- toSGML(self)
- Convert record to USMARC SGML
- toSimpleDC(self)
- Convert Marc into DC according to LC Crosswalk
Data and non-method functions defined here:
- __doc__ = "Parses data into 'fields' attribute, indexed by ...e of the first Python code I ever\n wrote.\n "
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'PyZ3950/zmarc'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- hdrbits = [5, 6, 7, 8, 17, 18, 19]
- list() -> new list
list(sequence) -> new list initialized from sequence's items
|
class MARC8_to_Unicode |
|
Converts MARC-8 to Unicode. Note that currently, unicode strings
aren't normalized, and some codecs (e.g. iso8859-1) will fail on
such strings. When I can require python 2.3, this will go away.
Warning: MARC-8 EACC (East Asian characters) makes some
distinctions which aren't captured in Unicode. The LC tables give
the option of mapping such characters either to a Unicode private
use area, or a substitute character which (usually) gives the
sense. I've picked the second, so this means that the MARC data
should be treated as primary and the Unicode data used for display
purposes only. (If you know of either of fonts designed for use
with LC's private-use Unicode assignments, or of attempts to
standardize Unicode characters to allow round-trips from EACC,
or if you need the private-use Unicode character translations,
please inform me, asl2@pobox.com. |
|
Methods defined here:
- __init__(self, G0=66, G1=69)
- is_multibyte(self, charset)
- translate(self, s)
Data and non-method functions defined here:
- __doc__ = 'Converts MARC-8 to Unicode. Note that currently...anslations,\n please inform me, asl2@pobox.com.'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'PyZ3950/zmarc'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- ansel = 69
- int(x[, base]) -> integer
Convert a string or number to an integer, if possible. A floating point
argument will be truncated towards zero (this does not include a string
representation of a floating point number!) When converting a string, use
the optional base. It is an error to supply a base when converting a
non-string.
- basic_latin = 66
- int(x[, base]) -> integer
Convert a string or number to an integer, if possible. A floating point
argument will be truncated towards zero (this does not include a string
representation of a floating point number!) When converting a string, use
the optional base. It is an error to supply a base when converting a
non-string.
|
|