Microsoft Azure Cognitive Services Search Namespace Package for Python 2/3 compatibility
64
Quality
Pending
Does it follow best practices?
Impact
64%
1.25xAverage score across 6 eval scenarios
A small helper module that keeps the azure.cognitiveservices.search namespace ready for dynamically loaded search service clients, even when those clients come from different installed packages.
sys.path, it returns their unique names in alphabetical order (e.g., imagesearch, websearch). @testModuleNotFoundError with a clear hint to install the appropriate search client package. @test@generates
from types import ModuleType
from typing import List
def discover_search_services() -> List[str]:
"""Return sorted unique service names found under the azure.cognitiveservices.search namespace."""
def load_search_service(service: str) -> ModuleType:
"""Import and return the azure.cognitiveservices.search.<service> module or raise an informative ModuleNotFoundError."""
def ensure_namespace_unzipped() -> List[str]:
"""Validate that the namespace path only contains real directories; raise a RuntimeError when a zipped path is present."""Keeps the namespace path extended across installed search service clients and remains unpacked for reliable discovery. @satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-azure-cognitiveservices-search-nspkg