mex.backend.auxiliary package¶
Submodules¶
mex.backend.auxiliary.models module¶
- class mex.backend.auxiliary.models.AuxiliarySearch(*, items: list[ExtractedItemT], total: int)¶
Bases:
BaseModel
,Generic
[ExtractedItemT
]Result of searching for extracted items in auxiliary sources.
- items: list[ExtractedItemT]¶
- 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[~ExtractedItemT], 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[ExtractedItemT], total: int)¶
Bases:
BaseModel
,Generic
[ExtractedItemT
]Result of searching for extracted items in auxiliary sources.
- items: list[ExtractedItemT]¶
- 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[~ExtractedItemT], 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