mex.extractors.rdmo package

Subpackages

Submodules

mex.extractors.rdmo.connector module

class mex.extractors.rdmo.connector.RDMOConnector

Bases: HTTPConnector

Connector class to handle authentication and requesting the RDMO API.

_set_authentication() None

Authenticate to the host.

_set_url() None

Set url of the host.

get_option_key(option: int) str

Return the human-readable key for an option ID, possibly from cache.

Parameters:

option – ID of the option

Returns:

Readable option key

Return type:

str

get_question_answer_pairs(project: int) dict[str, str]

Get a mapping of questions to answers for the given project.

Lookup all answered questions for the given project and check the responses: If the questions has a fixed set of answer options return the human-readable option key, if the question is free-text return the the answer string.

Parameters:

project – ID of the project

Returns:

Mapping of question paths to answers

Return type:

dict

get_question_path(attribute: int) str

Get the prefix-less UDI of an RDMO question, possibly from cache.

Parameters:

attribute – ID of the attribute

Raises:

MExError – If the attribute was not found

Returns:

Path of the question

Return type:

str

get_sources() Generator[RDMOSource, None, None]

Load RDMO sources by querying the RDMO API.

Returns:

Generator for RDMO sources

mex.extractors.rdmo.extract module

mex.extractors.rdmo.extract.extract_rdmo_source_contacts(rdmo_sources: Iterable[RDMOSource]) Generator[LDAPPerson, None, None]

Extract LDAP persons for RDMO owners.

Parameters:

rdmo_sources – RDMO sources

Returns:

Generator for LDAP persons

mex.extractors.rdmo.extract.extract_rdmo_sources() Generator[RDMOSource, None, None]

Load RDMO sources by querying the RDMO API.

Returns:

Generator for RDMO sources

mex.extractors.rdmo.main module

mex.extractors.rdmo.settings module

class mex.extractors.rdmo.settings.RDMOSettings(*, url: str = 'https://rdmo/', username: SecretStr = SecretStr('**********'), password: SecretStr = SecretStr('**********'))

Bases: BaseModel

RDMO settings submodel definition for the RDMO extractor.

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]] = {'password': FieldInfo(annotation=SecretStr, required=False, default=SecretStr('**********'), description='RDMO API password'), 'url': FieldInfo(annotation=str, required=False, default='https://rdmo/', description='RDMO instance URL'), 'username': FieldInfo(annotation=SecretStr, required=False, default=SecretStr('**********'), description='RDMO API user name')}

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.

password: SecretStr
url: str
username: SecretStr

mex.extractors.rdmo.transform module

mex.extractors.rdmo.transform.transform_rdmo_sources_to_extracted_activities(rdmo_sources: Iterable[RDMOSource], primary_source: ExtractedPrimarySource) Generator[ExtractedActivity, None, None]

Transform RDMO sources to extracted activities.

Parameters:
  • rdmo_sources – RDMO source iterable

  • primary_source – MEx primary_source for RDMO

Returns:

Generator for ExtractedActivities

Module contents