oarepo_oaipmh_harvester.oai_record.api
oarepo_oaipmh_harvester.oai_record.api
API for OAI harvested records.
OAIRecordAggregate
Bases: BaseAggregate
An aggregate of information about a harvested record.
Source code in oarepo_oaipmh_harvester/oai_record/api.py
model_cls = OAIRecordAggregateModel
class-attribute
instance-attribute
The model class for the request.
dumper = SearchDumper(extensions=[IndexedAtDumperExt(), AddHarvesterDumperExt(), ErrorsFacetDumperExt()], model_fields={'id': ('uuid', str)})
class-attribute
instance-attribute
Search dumper with configured extensions.
index = IndexField('oai-harvest-record-oai-harvest-record-v1.0.0', search_alias='oai-harvest-record')
class-attribute
instance-attribute
The search engine index to use.
oai_identifier = ModelField('oai_identifier', dump_type=str)
class-attribute
instance-attribute
The OAI identifier of the record.
record_pid = ModelField('record_pid', dump_type=str)
class-attribute
instance-attribute
The persistent identifier of the record.
datestamp = ModelField('datestamp', dump_type=datetime)
class-attribute
instance-attribute
The OAI datestamp of the record.
harvested_at = ModelField('harvested_at', dump_type=datetime)
class-attribute
instance-attribute
The time when the record was harvested.
deleted = ModelField('deleted', dump_type=bool)
class-attribute
instance-attribute
True if the record was deleted during the harvest.
has_errors = ModelField('has_errors', dump_type=bool)
class-attribute
instance-attribute
True if the record has errors during the harvest.
has_warnings = ModelField('has_warnings', dump_type=bool)
class-attribute
instance-attribute
True if the record has warnings during the harvest.
errors = ModelField('errors', dump_type=list[dict])
class-attribute
instance-attribute
Errors from the last write of the local record.
original_data = ModelField('original_data', dump_type=dict)
class-attribute
instance-attribute
Original data as harvested from the OAI-PMH source.
transformed_data = ModelField('transformed_data', dump_type=dict)
class-attribute
instance-attribute
Data after transformation, as written to the local record.
harvester_id = ModelField('harvester_id', dump_type=str)
class-attribute
instance-attribute
ID of the harvester that harvested the record.
harvester = ModelField('harvester', dump=False)
class-attribute
instance-attribute
The harvester of the record.
create(data: dict[str, Any], id_: UUID | None = None, **kwargs: Any) -> OAIRecordAggregate
classmethod
Create a new harvested record and store it in the database.
Source code in oarepo_oaipmh_harvester/oai_record/api.py
get_record(id_: UUID | str, with_deleted: bool = False) -> OAIRecordAggregate
classmethod
Get the harvested record with the specified ID.