mex.extractors.voxco package

Submodules

mex.extractors.voxco.extract module

mex.extractors.voxco.extract.extract_ldap_persons_voxco(voxco_resource_mappings: list[ResourceMapping]) list[LDAPPerson]

Extract LDAP persons for voxco.

Parameters:

voxco_resource_mappings – list of resource mapping models with default values

Returns:

list of LDAP persons

mex.extractors.voxco.extract.extract_voxco_organizations(voxco_resource_mappings: list[ResourceMapping]) dict[str, MergedOrganizationIdentifier]

Search and extract voxco organization from wikidata.

Parameters:

voxco_resource_mappings – voxco resource mapping models

Returns:

Dict with organization label and MergedOrganizationIdentifier

mex.extractors.voxco.extract.extract_voxco_variables() dict[str, list[VoxcoVariable]]

Extract voxco variables by loading data from mex-drop source json file.

Returns:

lists of voxco variables by json file name

mex.extractors.voxco.main module

mex.extractors.voxco.model module

class mex.extractors.voxco.model.VoxcoVariable(*, Id: int, DataType: str, Type: str, QuestionText: Annotated[str, MinLen(min_length=0)], Choices: list[str], Text: Annotated[str, MinLen(min_length=0)])

Bases: BaseModel

Model class for Voxco Variable.

Choices: list[str]
DataType: str
Id: int
QuestionText: str
Text: str
Type: str
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.voxco.settings module

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

Bases: BaseModel

Settings submodel for the Voxco extractor.

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.voxco.transform module

mex.extractors.voxco.transform.transform_voxco_resource_mappings_to_extracted_resources(voxco_resource_mappings: list[ResourceMapping], voxco_merged_organization_ids_by_query_string: dict[str, MergedOrganizationIdentifier], voxco_extracted_persons: list[ExtractedPerson], unit_stable_target_ids_by_synonym: dict[str, list[MergedOrganizationalUnitIdentifier]], extracted_organization_rki: ExtractedOrganization, international_projects_extracted_activities: list[ExtractedActivity]) dict[str, ExtractedResource]

Transform voxco resource mappings to extracted resources.

Parameters:
  • voxco_resource_mappings – voxco resource mapping models

  • voxco_merged_organization_ids_by_query_string – extracted voxco organizations dict

  • voxco_extracted_persons – extracted voxco mex persons

  • unit_stable_target_ids_by_synonym – merged organizational units by name

  • extracted_organization_rki – extracted rki organization

  • voxco_extracted_primary_source – extracted voxco primary source

  • international_projects_extracted_activities – list of international projects

Returns:

dict extracted voxco resource by identifier in primary source

mex.extractors.voxco.transform.transform_voxco_variable_mappings_to_extracted_variables(voxco_extracted_resources_by_str: dict[str, ExtractedResource], voxco_variables: dict[str, list[VoxcoVariable]]) list[ExtractedVariable]

Transform voxco variable mappings to extracted variables.

Parameters:
  • voxco_extracted_resources_by_str – extracted voxco resources

  • voxco_variables – list of voxco variables by associated resource

Returns:

list of extracted variables

Module contents