httk.serve.optimade.endpoints.partial_data¶
The partial data endpoint, streaming large property values as JSON Lines.
See the OPTIMADE specification appendix “OPTIMADE JSON Lines partial data
format”. A backend exposes a large or sliceable property value as a
PartialValue; this endpoint fetches it
in chunks of config.partial_data_chunk_size outer items and emits the
JSON Lines document, with a next-marker when more data remains.
Functions¶
|
Produce the JSON Lines partial-data reply for one property value. |
Module Contents¶
- httk.serve.optimade.endpoints.partial_data.generate_partial_data_reply(request, config, query_function, schema)[source]¶
Produce the JSON Lines partial-data reply for one property value.
- Parameters:
request (httk.serve.optimade.model.request.ValidatedRequest) – Validated partial-data request.
config (httk.serve.optimade.model.config.OptimadeConfig) – Service configuration controlling chunk size.
query_function (httk.serve.optimade.model.results.QueryFunction) – Callback used to retrieve the entry.
schema (httk.serve.optimade.schema.served.ServedSchema) – Served schema used by the request engine.
- Returns:
JSON Lines response.
- Raises:
httk.serve.optimade.model.errors.OptimadeError – If the entry, property, or partial-data length is unavailable.
- Return type: