httk.serve.optimade.endpoints.entries

Attributes

Functions

generate_entry_endpoint_reply(request, config, data[, ...])

Build a JSON:API collection response for an entry endpoint.

generate_single_entry_endpoint_reply(request, config, data)

Build a JSON:API single-resource response for an entry identifier.

Module Contents

httk.serve.optimade.endpoints.entries.RelatedResolver[source]
httk.serve.optimade.endpoints.entries.generate_entry_endpoint_reply(request, config, data, data_available=None, related_resolver=None)[source]

Build a JSON:API collection response for an entry endpoint.

Parameters:
Returns:

JSON:API collection document.

Return type:

dict[str, Any]

httk.serve.optimade.endpoints.entries.generate_single_entry_endpoint_reply(request, config, data, data_available=None, related_resolver=None)[source]

Build a JSON:API single-resource response for an entry identifier.

Parameters:
Returns:

JSON:API single-resource document.

Raises:

httk.serve.optimade.model.errors.OptimadeError – If the query yields multiple rows or another page.

Return type:

dict[str, Any]