mex.extractors.endnote package

Submodules

mex.extractors.endnote.checks module

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.extract.find_text_from_record(record: Element, path: str) str | None

Finds the instance of an item in path.

mex.extractors.endnote.extract.findall_text_from_record(record: Element, path: str) list[str]

Finds all instances of items in path.

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_config: ClassVar[ConfigDict] = {}

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

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'), cutoff_number_authors: int = 42)

Bases: BaseModel

Settings submodel for the endnote extractor.

cutoff_number_authors: int
mapping_path: AssetsPath
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_by_alias': True, 'validate_by_name': True, 'validate_default': True}

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

mex.extractors.endnote.transform module

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

Extract endnote bibliographic resources.

Parameters:
  • endnote_records – list of endnote record

  • endnote_bib_resource_mapping – bibliographical resource mapping

  • endnote_extracted_persons_by_person_str – extracted endnote persons by name

  • unit_stable_target_ids_by_synonym – Unit stable target ids by synonym

Returns:

list of extracted bibliographic resource

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

Extract endnote consent.

Parameters:
  • extracted_endnote_persons – list of endnote persons

  • 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]) dict[str, ExtractedPerson]

Extract endnote persons.

Parameters:

endnote_records – list of endnote record

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