mex.extractors.endnote package

Submodules

mex.extractors.endnote.extract module

mex.extractors.endnote.extract.extract_endnote_records() list[EndnoteRecord]

Extract endnote records by loading XML files from MEx drop.

Returns:

list of endnote records

mex.extractors.endnote.main module

mex.extractors.endnote.model module

class mex.extractors.endnote.model.EndnoteRecord(*, abstract: str | None, authors: list[str], call_num: str | None, custom3: str | None, custom4: str | None, custom6: str | None, database: str | None, electronic_resource_num: str | None, isbn: str | None, keyword: list[str], language: str | None, number: str | None, pages: str | None, periodical: list[str], pub_dates: list[str], publisher: str | None, rec_number: str | None, ref_type: str, related_urls: list[str], secondary_authors: list[str], secondary_title: str | None, tertiary_authors: list[str], title: str, volume: str | None, year: str | None)

Bases: BaseModel

Model class for endnote record type entities.

abstract: str | None
authors: list[str]
call_num: str | None
custom3: str | None
custom4: str | None
custom6: str | None
database: str | None
electronic_resource_num: str | None
isbn: str | None
keyword: list[str]
language: str | None
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'abstract': FieldInfo(annotation=Union[str, NoneType], required=True), 'authors': FieldInfo(annotation=list[str], required=True), 'call_num': FieldInfo(annotation=Union[str, NoneType], required=True), 'custom3': FieldInfo(annotation=Union[str, NoneType], required=True), 'custom4': FieldInfo(annotation=Union[str, NoneType], required=True), 'custom6': FieldInfo(annotation=Union[str, NoneType], required=True), 'database': FieldInfo(annotation=Union[str, NoneType], required=True), 'electronic_resource_num': FieldInfo(annotation=Union[str, NoneType], required=True), 'isbn': FieldInfo(annotation=Union[str, NoneType], required=True), 'keyword': FieldInfo(annotation=list[str], required=True), 'language': FieldInfo(annotation=Union[str, NoneType], required=True), 'number': FieldInfo(annotation=Union[str, NoneType], required=True), 'pages': FieldInfo(annotation=Union[str, NoneType], required=True), 'periodical': FieldInfo(annotation=list[str], required=True), 'pub_dates': FieldInfo(annotation=list[str], required=True), 'publisher': FieldInfo(annotation=Union[str, NoneType], required=True), 'rec_number': FieldInfo(annotation=Union[str, NoneType], required=True), 'ref_type': FieldInfo(annotation=str, required=True), 'related_urls': FieldInfo(annotation=list[str], required=True), 'secondary_authors': FieldInfo(annotation=list[str], required=True), 'secondary_title': FieldInfo(annotation=Union[str, NoneType], required=True), 'tertiary_authors': FieldInfo(annotation=list[str], required=True), 'title': FieldInfo(annotation=str, required=True), 'volume': FieldInfo(annotation=Union[str, NoneType], required=True), 'year': FieldInfo(annotation=Union[str, NoneType], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

number: str | None
pages: str | None
periodical: list[str]
pub_dates: list[str]
publisher: str | None
rec_number: str | None
ref_type: str
related_urls: list[str]
secondary_authors: list[str]
secondary_title: str | None
tertiary_authors: list[str]
title: str
volume: str | None
year: str | None

mex.extractors.endnote.settings module

class mex.extractors.endnote.settings.EndnoteSettings(*, mapping_path: AssetsPath = AssetsPath('mappings/endnote'))

Bases: BaseModel

Settings submodel for the endnote extractor.

mapping_path: AssetsPath
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'populate_by_name': True, 'str_max_length': 100000, 'str_min_length': 1, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'mapping_path': FieldInfo(annotation=AssetsPath, required=False, default=AssetsPath("mappings/endnote"), description='Path to the directory with the endnote mapping files containing the default values, absolute path or relative to `assets_dir`.')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

mex.extractors.endnote.transform module

mex.extractors.endnote.transform.extract_endnote_bibliographic_resource(endnote_records: list[EndnoteRecord], endnote_bib_resource_mapping: BibliographicResourceMapping, extracted_endnote_persons_by_person_string: dict[str, ExtractedPerson], unit_stable_target_ids_by_synonym: dict[str, MergedOrganizationalUnitIdentifier], extracted_primary_source_endnote: ExtractedPrimarySource) list[ExtractedBibliographicResource]

Extract endnote bibliographic resources.

Parameters:
  • endnote_records – list of endnote record

  • endnote_bib_resource_mapping – bibliographical resource mapping

  • extracted_endnote_persons_by_person_string – extracted endnote persons by name

  • unit_stable_target_ids_by_synonym – Unit stable target ids by synonym

  • extracted_primary_source_endnote – primary source for endnote

Returns:

list of extracted bibliographic resource

mex.extractors.endnote.transform.extract_endnote_consents(extracted_endnote_persons: list[ExtractedPerson], extracted_primary_source_endnote: ExtractedPrimarySource, endnote_consent_mapping: ConsentMapping) list[ExtractedConsent]

Extract endnote consent.

Parameters:
  • extracted_endnote_persons – list of endnote persons

  • extracted_primary_source_endnote – primary source for endnote

  • endnote_consent_mapping – endnote consent mapping default values

Returns:

list of extracted consent

mex.extractors.endnote.transform.extract_endnote_persons_by_person_string(endnote_records: list[EndnoteRecord], extracted_primary_source_endnote: ExtractedPrimarySource) dict[str, ExtractedPerson]

Extract endnote persons.

Parameters:
  • endnote_records – list of endnote record

  • extracted_primary_source_endnote – primary source for endnote

Returns:

extracted persons by person string

mex.extractors.endnote.transform.get_doi(electronic_resource_num: str | None, endnote_bibliographic_resource: BibliographicResourceMapping) str | None

Extract doi string and validate.

Parameters:
  • electronic_resource_num – list of electronic resource num string

  • endnote_bibliographic_resource – bibliographic resource mapping

Returns:

doi string or None

Module contents