CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-azure-cognitiveservices-search-nspkg

Microsoft Azure Cognitive Services Search Namespace Package for Python 2/3 compatibility

64

1.25x

Quality

Pending

Does it follow best practices?

Impact

64%

1.25x

Average score across 6 eval scenarios

Overview
Eval results
Files

task.mdevals/scenario-1/

Azure Search Namespace Resolver

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.

Capabilities

Discover search services

  • When multiple service subpackages live under the namespace on sys.path, it returns their unique names in alphabetical order (e.g., imagesearch, websearch). @test

Load specific service

  • Loading an installed service name returns the corresponding namespace module so callers can use it directly. @test
  • Requesting a missing service raises ModuleNotFoundError with a clear hint to install the appropriate search client package. @test

Enforce unpacked namespace

  • When every namespace path entry is a real directory, it accepts them and returns the normalized paths. @test
  • When any namespace path entry points to a zip archive or zipped egg, it raises an error explaining the namespace must stay unzipped for discovery to work. @test

Implementation

@generates

API

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."""

Dependencies { .dependencies }

azure-cognitiveservices-search-nspkg { .dependency }

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

tile.json