api.services.catalog_lookup =========================== .. py:module:: api.services.catalog_lookup .. autoapi-nested-parse:: Read-only Airtable lookups for the product intake workflow: reference lists for the app's forms (brands, equipment types, specification keys, expected specifications per family, Unit condition choices) and candidate existing Models for catalog matching (spec §6B). Attributes ---------- .. autoapisummary:: api.services.catalog_lookup.SPEC_TYPE_TABLE_NAME api.services.catalog_lookup.EXPECTED_SPECS_TABLE_NAME api.services.catalog_lookup.OPTIONS_TTL_SECONDS Functions --------- .. autoapisummary:: api.services.catalog_lookup.clear_options_cache api.services.catalog_lookup.load_options api.services.catalog_lookup.normalize api.services.catalog_lookup.find_candidate_models Module Contents --------------- .. py:data:: SPEC_TYPE_TABLE_NAME :value: 'Specification type' .. py:data:: EXPECTED_SPECS_TABLE_NAME :value: 'Specs attendues par Famille' .. py:data:: OPTIONS_TTL_SECONDS :value: 600 .. py:function:: clear_options_cache() -> None .. py:function:: load_options() -> dict[str, Any] .. py:function:: normalize(text: str) -> str Lowercase, strip accents and punctuation: "Mikro 220 R" ~ "mikro-220r". .. py:function:: find_candidate_models(brand: str, model: str, limit: int = 8) -> list[dict[str, Any]] Existing Models whose reference contains the normalized model string (and whose brand contains the brand, when given), with their Variations. A suggestion only: the app shows these and a human decides (§6B).