Cheshire3 Object Model - Record

API

class cheshire3.baseObjects.Record(data, xml='', docId=None, wordCount=0, byteCount=0)[source]

A Record is a wrapper for parsed data and its metadata.

Records in the system are commonly stored in an XML form. Attached to the record is various configurable metadata, such as the time it was inserted into the database and by which user. Records are stored in a RecordStore and retrieved via a persistent and unique identifier. The record data may be retrieved as a list of SAX events, as regularised XML, as a DOM tree or ElementTree.

fetch_vector(session, index, summary=False)[source]

Fetch and return a vector for the Record from the given Index.

get_dom(session)[source]

Return the DOM document node for the record.

get_sax(session)[source]

Return the list of SAX events for the record

SAX events are serialized according to the internal Cheshire3 format.

get_xml(session)[source]

Return the XML for the record as a serialized string.

process_xpath(session, xpath, maps={})[source]

Process and return the result of the given XPath

XPath may be either a string or a configured XPath, perhaps with some supplied namespace mappings.

Implementations

The following implementations are included in the distribution by default:

class cheshire3.record.LxmlRecord(data, xml='', docId=None, wordCount=0, byteCount=0)[source]
class cheshire3.record.MinidomRecord(data, xml='', docId=None, wordCount=0, byteCount=0)[source]
class cheshire3.record.SaxRecord(data, xml='', docId=None, wordCount=0, byteCount=0)[source]
class cheshire3.record.MarcRecord(data, xml='', docId=0, wordCount=0, byteCount=0)[source]

For dealing with Library MARC Records.

The class that you interact with will almost certainly depend on which Parser you used.

In addition to the default implementation, the cheshire3.graph provides the following implementations: