Skip to content

sok.core.adapters.media_adapters

Media adapter registry and convenience functions.

Provides centralized access to content-type-specific adapters for normalizing API responses.

Modules

Functions

adapt_details

def adapt_details(
content_type: ContentType,
payload: Dict[str, Any],
) -> Dict[str, Any]:

Adapt detail response using the appropriate adapter.

Parameters

NameTypeDescription
content_typeContentTypeType of content.
payloadDict[str, Any]Raw API detail response.

Returns

  • Dict[str, Any]Normalized detail dictionary.
Source

adapt_search_results

def adapt_search_results(
content_type: ContentType,
results: List[Dict[str, Any]],
) -> Dict[str, List[Dict[str, Any]]]:

Adapt search results using the appropriate adapter.

Parameters

NameTypeDescription
content_typeContentTypeType of content being searched.
resultsList[Dict[str, Any]]Raw API search results.

Returns

  • Dict[str, List[Dict[str, Any]]]Normalized search results dictionary.
Source
Built with Kiln