swh.core.api.negotiation module# exception swh.core.api.negotiation.FormatterNotFound[source]# Bases: Exception class swh.core.api.negotiation.Formatter(request_mimetype: str | None = None)[source]# Bases: object format: str | None = None# mimetypes: List[str] = []# configure() → None[source]# render(obj: Any) → bytes[source]# class swh.core.api.negotiation.Negotiator(func: Callable[[...], Any])[source]# Bases: object register_formatter(formatter: Type[Formatter], *args, **kwargs) → None[source]# get_formatter(format: str | None = None, mimetype: str | None = None) → Formatter[source]# property accept_mimetypes: List[str]# best_mimetype() → str[source]# swh.core.api.negotiation.negotiate(negotiator_cls: Type[Negotiator], formatter_cls: Type[Formatter], *args, **kwargs) → Callable[source]#