| |
- exceptions.Exception
-
- ZoomError
-
- Bib1Err
- ClientNotImplError
- ConnectionError
- ProtocolError
-
- UnexpectedCloseError
- QuerySyntaxError
- ServerNotImplError
- UnknownRecSyn
- Query
- Record
- _AttrCheck
-
- Connection(_AttrCheck, _ErrHdlr)
- ResultSet(_AttrCheck, _ErrHdlr)
- ScanSet(_AttrCheck, _ErrHdlr)
- SortKey
- _ErrHdlr
-
- SurrogateDiagnostic
- _RecordType
class Bib1Err(ZoomError) |
|
Exception for BIB-1 error |
|
- Method resolution order:
- Bib1Err
- ZoomError
- exceptions.Exception
Methods defined here:
- __init__(self, condition, message, addtlInfo)
- __str__(self)
Data and non-method functions defined here:
- __doc__ = 'Exception for BIB-1 error'
- 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/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from exceptions.Exception:
- __getitem__(...)
|
class ClientNotImplError(ZoomError) |
|
Exception for ZOOM client-side functionality not implemented (bug
author) |
|
- Method resolution order:
- ClientNotImplError
- ZoomError
- exceptions.Exception
Data and non-method functions defined here:
- __doc__ = 'Exception for ZOOM client-side functionality not implemented (bug\n author)'
- 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/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from exceptions.Exception:
- __getitem__(...)
- __init__(...)
- __str__(...)
|
class Connection(_AttrCheck, _ErrHdlr) |
|
Connection object |
|
- Method resolution order:
- Connection
- _AttrCheck
- _ErrHdlr
Methods defined here:
- __init__(self, host, port, connect=1, **kw)
- Establish connection to hostname:port. kw contains initial
values for options, and is useful for options which affect
the InitializeRequest. Currently supported values:
user Username for authentication
password Password for authentication
group Group for authentication
maximumRecordSize Maximum size in bytes of one record
preferredMessageSize Maximum size in bytes for response
lang 3 letter language code
charset Character set
implementationId Id for client implementation
implementationName Name for client implementation
implementationVersion Version of client implementation
- _make_rsn(self)
- Return result set name
- close(self)
- Close connection
- connect(self)
- scan(self, query)
- # and 'Error Code', 'Error Message', and 'Addt'l Info' methods still
# eeded
- search(self, query)
- Search, taking Query object, returning ResultSet
- sort(self, sets, keys)
- Sort sets by keys, return resultset interface
Data and non-method functions defined here:
- __doc__ = 'Connection object'
- 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/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- _cli = None
- _queryTypes = ['S-CQL', 'S-CCL', 'RPN', 'ZSQL']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
- attrlist = ['smallSetUpperBound', 'largeSetLowerBound', 'mediumSetPresentNumber', 'smallSetElementSetNames', 'mediumSetElementSetNames', 'user', 'password', 'group', 'maximumRecordSize', 'preferredMessageSize', 'lang', 'charset', 'implementationId', 'implementationName', 'implementationVersion', 'stepSize', 'numberOfEntries', 'responsePosition', 'databaseName', 'namedResultSets', ...]
- list() -> new list
list(sequence) -> new list initialized from sequence's items
- charset = None
- databaseName = 'Default'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- elementSetName = 'F'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- group = None
- host = ''
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- implementationId = 'PyZ3950'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- implementationName = 'PyZ3950 1.0/ZOOM v1.4'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- implementationVersion = '1.0'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- init_attrs = ['user', 'password', 'group', 'maximumRecordSize', 'preferredMessageSize', 'lang', 'charset', 'implementationId', 'implementationName', 'implementationVersion']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
- lang = None
- maximumRecordSize = 1048576
- 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.
- namedResultSets = 1
- 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.
- not_implement_attrs = ['piggyback', 'schema', 'proxy', 'async']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
- numberOfEntries = 20
- 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.
- password = None
- port = 0
- 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.
- preferredMessageSize = 1048576
- 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.
- preferredRecordSyntax = 'USMARC'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- presentChunk = 20
- 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.
- responsePosition = 1
- 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.
- scan_zoom_to_z3950 = {'numberOfEntries': 'numberOfTermsRequested', 'responsePosition': 'preferredPositionInResponse', 'stepSize': 'stepSize'}
- dict() -> new empty dictionary.
dict(mapping) -> new dictionary initialized from a mapping object's
(key, value) pairs.
dict(seq) -> new dictionary initialized as if via:
d = {}
for k, v in seq:
d[k] = v
- search_attrs = ['smallSetUpperBound', 'largeSetLowerBound', 'mediumSetPresentNumber', 'smallSetElementSetNames', 'mediumSetElementSetNames']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
- stepSize = 0
- 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.
- user = None
Methods inherited from _AttrCheck:
- __setattr__(self, attr, val)
- Ensure attr is in attrlist (list of allowed attributes), or
private (begins w/ '_'), or begins with 'X-' (reserved for users)
Methods inherited from _ErrHdlr:
- err(self, condition, addtlInfo, oid)
- Translate condition + oid to message, save, and raise exception
- err_diagrec(self, diagrec)
Data and non-method functions inherited from _ErrHdlr:
- err_attrslist = ['errCode', 'errMsg', 'addtlInfo']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
|
class ProtocolError(ZoomError) |
|
Exception for malformatted server response |
|
- Method resolution order:
- ProtocolError
- ZoomError
- exceptions.Exception
Data and non-method functions defined here:
- __doc__ = 'Exception for malformatted server response'
- 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/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from exceptions.Exception:
- __getitem__(...)
- __init__(...)
- __str__(...)
|
class Query |
|
|
|
Methods defined here:
- __init__(self, typ, query)
- Creates Query object.
Supported query types: CCL, S-CCL, CQL, S-CQL, PQF, C2, ZSQL, CQL-TREE
Data and non-method functions defined here:
- __doc__ = None
- __module__ = 'PyZ3950/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
|
class Record |
|
Represent retrieved record. 'syntax' attribute is a string,
'data' attribute is the data, which is:
USMARC -- raw MARC data
SUTRS -- a string (possibly in the future unicode)
XML -- ditto
GRS-1 -- a tree (see grs1.py for details)
EXPLAIN -- a hard-to-describe format (contact me if you're actually using this)
OPAC -- ditto
Other representations are not yet defined. |
|
Methods defined here:
- __init__(self, oid, data, dbname)
- Only for use by ResultSet
- __str__(self)
- Render printably
- get_field(self, spec)
- Get field
- get_fieldcount(self)
- Get number of fields
- is_surrogate_diag(self)
Data and non-method functions defined here:
- __doc__ = "Represent retrieved record. 'syntax' attribute ...\n Other representations are not yet defined."
- 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/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
|
class ResultSet(_AttrCheck, _ErrHdlr) |
|
Cache results, presenting read-only sequence interface. If
a surrogate diagnostic is returned for the i-th record, an
appropriate exception will be raised on access to the i-th
element (either access by itself or as part of a slice). |
|
- Method resolution order:
- ResultSet
- _AttrCheck
- _ErrHdlr
Methods defined here:
- __getattr__(self, key)
- Forward attribute access to Connection if appropriate
- __getitem__(self, i)
- Ensure item is present, and return a Record
- __getslice__(self, i, j)
- __init__(self, conn, searchResult, resultSetName, ctr)
- Only for creation by Connection object
- __len__(self)
- Get number of records
- _check_stale(self)
- _ensure_present(self, i)
- _ensure_recs(self)
- _extract_recs(self, records, lbound)
- _get_rec(self, i)
- _make_keywords(self)
- Set up dict of parms for present request
- _pin(self, i)
- Handle negative indices
- delete(self)
- Delete result set
- sort(self, keys)
Data and non-method functions defined here:
- __doc__ = 'Cache results, presenting read-only sequence int... (either access by itself or as part of a slice).'
- 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/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- attrlist = ['elementSetName', 'preferredRecordSyntax', 'presentChunk', 'errCode', 'errMsg', 'addtlInfo']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
- inherited_elts = ['elementSetName', 'preferredRecordSyntax', 'presentChunk']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
- not_implement_attrs = ['piggyback', 'schema']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
Methods inherited from _AttrCheck:
- __setattr__(self, attr, val)
- Ensure attr is in attrlist (list of allowed attributes), or
private (begins w/ '_'), or begins with 'X-' (reserved for users)
Methods inherited from _ErrHdlr:
- err(self, condition, addtlInfo, oid)
- Translate condition + oid to message, save, and raise exception
- err_diagrec(self, diagrec)
Data and non-method functions inherited from _ErrHdlr:
- err_attrslist = ['errCode', 'errMsg', 'addtlInfo']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
|
class ScanSet(_AttrCheck, _ErrHdlr) |
|
Hold result of scan. |
|
- Method resolution order:
- ScanSet
- _AttrCheck
- _ErrHdlr
Methods defined here:
- __getitem__(self, i)
- __getslice__(self, i, j)
- __init__(self, scanresp)
- For internal use only!
- __len__(self)
- Return number of entries
- _get_rec(self, i)
- _pin(self, i)
- get_field(self, field, i)
- Returns value of field:
term: term
freq: integer
display: string
attrs: currently z3950 structure, should be string of attributes
alt: currently z3950 structure, should be [string of attrs, term]
other: currently z3950 structure, dunno what the best Python representation would be
- get_fields(self, i)
- Return a dictionary mapping ZOOM's field names to values
present in the response. (Like get_field, but for all fields.)
- get_term(self, i)
- Return term. Note that get_{term,field,fields} can throw an
exception if the i'th term is a surrogate diagnostic.
Data and non-method functions defined here:
- __doc__ = 'Hold result of scan.\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/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- attrlist = ['errCode', 'errMsg', 'addtlInfo']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
- zoom_to_z3950 = {'alt': 'alternativeTerm', 'attrs': 'suggestedAttributes', 'display': 'displayTerm', 'freq': 'globalOccurrences', 'other': 'otherTermInfo'}
- dict() -> new empty dictionary.
dict(mapping) -> new dictionary initialized from a mapping object's
(key, value) pairs.
dict(seq) -> new dictionary initialized as if via:
d = {}
for k, v in seq:
d[k] = v
Methods inherited from _AttrCheck:
- __setattr__(self, attr, val)
- Ensure attr is in attrlist (list of allowed attributes), or
private (begins w/ '_'), or begins with 'X-' (reserved for users)
Data and non-method functions inherited from _AttrCheck:
- not_implement_attrs = []
- list() -> new list
list(sequence) -> new list initialized from sequence's items
Methods inherited from _ErrHdlr:
- err(self, condition, addtlInfo, oid)
- Translate condition + oid to message, save, and raise exception
- err_diagrec(self, diagrec)
Data and non-method functions inherited from _ErrHdlr:
- err_attrslist = ['errCode', 'errMsg', 'addtlInfo']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
|
class SortKey(_AttrCheck) |
|
|
|
Methods defined here:
- __init__(self, **kw)
Data and non-method functions defined here:
- __doc__ = None
- __module__ = 'PyZ3950/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- attrlist = ['relation', 'caseInsensitive', 'missingValueAction', 'missingValueData', 'type', 'sequence']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
- caseInsensitive = 1
- 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.
- missingValueAction = ''
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- missingValueData = ''
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- relation = 'ascending'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- sequence = ''
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- type = 'accessPoint'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from _AttrCheck:
- __setattr__(self, attr, val)
- Ensure attr is in attrlist (list of allowed attributes), or
private (begins w/ '_'), or begins with 'X-' (reserved for users)
Data and non-method functions inherited from _AttrCheck:
- not_implement_attrs = []
- list() -> new list
list(sequence) -> new list initialized from sequence's items
|
class SurrogateDiagnostic(_ErrHdlr) |
|
Represent surrogate diagnostic. Raise appropriate exception
on access to syntax or data, or when raise_exn method is called.
Currently, RecordSet relies on the return from is_surrogate_diag (),
and calls raise_exn based on that. |
|
Methods defined here:
- __getattr__(self, attr)
- __init__(self, diagrec)
- is_surrogate_diag(self)
- raise_exn(self)
Data and non-method functions defined here:
- __doc__ = 'Represent surrogate diagnostic. Raise appropria...e_diag (),\n and calls raise_exn based on that.'
- 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/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from _ErrHdlr:
- err(self, condition, addtlInfo, oid)
- Translate condition + oid to message, save, and raise exception
- err_diagrec(self, diagrec)
Data and non-method functions inherited from _ErrHdlr:
- err_attrslist = ['errCode', 'errMsg', 'addtlInfo']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
|
class UnknownRecSyn(ZoomError) |
|
Exception for unknown record syntax returned from server |
|
- Method resolution order:
- UnknownRecSyn
- ZoomError
- exceptions.Exception
Data and non-method functions defined here:
- __doc__ = 'Exception for unknown record syntax returned from server'
- 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/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from exceptions.Exception:
- __getitem__(...)
- __init__(...)
- __str__(...)
|
class ZoomError(exceptions.Exception) |
|
Base class for all errors reported from this module |
|
Data and non-method functions defined here:
- __doc__ = 'Base class for all errors reported from this module'
- 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/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from exceptions.Exception:
- __getitem__(...)
- __init__(...)
- __str__(...)
|
class _AttrCheck |
|
Prevent typos |
|
Methods defined here:
- __setattr__(self, attr, val)
- Ensure attr is in attrlist (list of allowed attributes), or
private (begins w/ '_'), or begins with 'X-' (reserved for users)
Data and non-method functions defined here:
- __doc__ = 'Prevent typos'
- 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/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- attrlist = []
- list() -> new list
list(sequence) -> new list initialized from sequence's items
- not_implement_attrs = []
- list() -> new list
list(sequence) -> new list initialized from sequence's items
|
class _ErrHdlr |
|
Error-handling services |
|
Methods defined here:
- err(self, condition, addtlInfo, oid)
- Translate condition + oid to message, save, and raise exception
- err_diagrec(self, diagrec)
Data and non-method functions defined here:
- __doc__ = 'Error-handling services'
- 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/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- err_attrslist = ['errCode', 'errMsg', 'addtlInfo']
- list() -> new list
list(sequence) -> new list initialized from sequence's items
|
class _RecordType |
|
Map syntax string to OID and per-syntax utility functions |
|
Methods defined here:
- __init__(self, name, oid, renderer=<function <lambda>>, fieldcount=<function <lambda>>, field=None, preproc=<function <lambda>>)
- Register syntax
Data and non-method functions defined here:
- __doc__ = 'Map syntax string to OID and per-syntax utility functions'
- 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/zoom'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
| |