mex.backend.auxiliary package¶
Submodules¶
mex.backend.auxiliary.ldap module¶
- mex.backend.auxiliary.ldap.extracted_organizational_unit() list[ExtractedOrganizationalUnit] ¶
Auxilary function to get ldap as primary resource.
- mex.backend.auxiliary.ldap.extracted_primary_source_ldap() ExtractedPrimarySource ¶
Load and return ldap primary source.
- mex.backend.auxiliary.ldap.search_person_in_ldap(q: Annotated[str, Query(PydanticUndefined)], offset: Annotated[int, Query(PydanticUndefined)] = 0, limit: Annotated[int, Query(PydanticUndefined)] = 10) AuxiliarySearch[ExtractedPerson] ¶
Search for persons in LDAP by string.
- Parameters:
q – The name of the person to be searched.
offset – The starting index for pagination
limit – The maximum number of results to return
- Returns:
paginated list of ExtractedPerson and the total count of persons found.
mex.backend.auxiliary.models module¶
- class mex.backend.auxiliary.models.AuxiliarySearch(*, items: list[ExtractedModelT], total: int)¶
Bases:
BaseModel
,Generic
[ExtractedModelT
]Result of searching for extracted items in auxiliary sources.
- items: list[ExtractedModelT]¶
- 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]] = {'items': FieldInfo(annotation=list[~ExtractedModelT], required=True), 'total': FieldInfo(annotation=int, 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.
- total: int¶
- class mex.backend.auxiliary.models.AuxiliarySearch(*, items: list[ExtractedModelT], total: int)¶
Bases:
BaseModel
,Generic
[ExtractedModelT
]Result of searching for extracted items in auxiliary sources.
- items: list[ExtractedModelT]¶
- 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]] = {'items': FieldInfo(annotation=list[~ExtractedModelT], required=True), 'total': FieldInfo(annotation=int, 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.
- total: int¶
- class mex.backend.auxiliary.models.AuxiliarySearch(*, items: list[ExtractedModelT], total: int)¶
Bases:
BaseModel
,Generic
[ExtractedModelT
]Result of searching for extracted items in auxiliary sources.
- items: list[ExtractedModelT]¶
- 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]] = {'items': FieldInfo(annotation=list[~ExtractedModelT], required=True), 'total': FieldInfo(annotation=int, 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.
- total: int¶
mex.backend.auxiliary.wikidata module¶
- mex.backend.auxiliary.wikidata.extracted_primary_source_wikidata() ExtractedPrimarySource ¶
Load and return wikidata primary source.
- mex.backend.auxiliary.wikidata.search_organization_in_wikidata(q: Annotated[str, Query(PydanticUndefined)], offset: Annotated[int, Query(PydanticUndefined)] = 0, limit: Annotated[int, Query(PydanticUndefined)] = 10, lang: TextLanguage = TextLanguage.EN) AuxiliarySearch[ExtractedOrganization] ¶
Search for organizations in wikidata.
- Parameters:
q – label of the organization to be searched
offset – start page number
limit – end page number
lang – language of the label. Example: en, de
- Returns:
Paginated list of ExtractedOrganizations