httk.serve.optimade.model.results

Classes

ResultRow

Represent one entry result and its envelope data.

QueryResults

The results of a query against a backend, as consumed by the entry endpoints.

QueryFunction

The callback seam through which the request engine runs queries on a backend.

OptimadeAdapter

Structural adapter contract consumed by the public serving helpers.

Module Contents

class httk.serve.optimade.model.results.ResultRow[source]

Represent one entry result and its envelope data.

Parameters:
  • values – Response-field values keyed by OPTIMADE property name.

  • relationships – Related resources keyed by entry type.

  • property_metadata – Per-property metadata keyed by response field.

values: dict[str, Any][source]
relationships: dict[str, list[dict[str, Any]]][source]
property_metadata: dict[str, Any][source]
class httk.serve.optimade.model.results.QueryResults[source]

Bases: Protocol

The results of a query against a backend, as consumed by the entry endpoints.

Iteration yields one ResultRow per entry; its values map OPTIMADE response-field names to values, and the id and type keys are always present.

property more_data_available: bool[source]

Report whether another page is available.

count()[source]

Return the total number of matches before pagination.

class httk.serve.optimade.model.results.QueryFunction[source]

Bases: Protocol

The callback seam through which the request engine runs queries on a backend.

class httk.serve.optimade.model.results.OptimadeAdapter[source]

Bases: Protocol

Structural adapter contract consumed by the public serving helpers.

Query execution may be backed by the ordinary Store/Searcher adapter or a storage federation with its own bounded paging policy. The HTTP layer only needs the served schema and a callback implementing QueryFunction.

property schema: httk.serve.optimade.schema.served.ServedSchema[source]

Return the schema supplied by the adapter.

query_function()[source]

Return the callback used to execute entry queries.