Package telemeta :: Package interop :: Module oai :: Class IDataSource
[hide private]
[frames] | no frames]

Class IDataSource

source code

object --+
         |
        IDataSource

Interface for OAI datasource adapters

Instance Methods [hide private]
 
get_earliest_time(self)
Must return the change time of the oldest record(s) as a datetime object
source code
 
get_record(self, id)
Must return a tuple of the form: ( [(dublin core element, element value), ...], change time ) or None if the record doesn't exist.
source code
 
count_records(self, from_time=None, until_time=None)
Must return the number of records between (optional) from and until change time.
source code
 
list_records(self, offset, limit, from_time=None, until_time=None)
Must return the list of records between (optional) from and until change time, starting from record at offset, with a maximum of limit entries.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

get_record(self, id)

source code 
Must return a tuple of the form:
   (
     [(dublin core element, element value), ...],
     change time
   )
or None if the record doesn't exist. In case the id isn't wellformed
a BadArgumentError should be raised.

The dublin core data must contain an 'identifier' element, which is the same
as the id parameter.

list_records(self, offset, limit, from_time=None, until_time=None)

source code 

Must return the list of records between (optional) from and until change time, starting from record at offset, with a maximum of limit entries. Each entry of the list must be a tuple of the same form as returned by getRecord().

If no record matches, should return an empty list. The dublin core data must contain an 'identifier' element, which can be used as a parameter to get_record().