httk.optimade.model¶
Submodules¶
Attributes¶
Exceptions¶
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
Classes¶
Configuration of a served OPTIMADE database. |
|
A response produced by an endpoint, to be serialized by the web layer. |
|
An incoming OPTIMADE request, as handed over by the web layer. |
|
Validated URL query parameters of an OPTIMADE request. |
|
The result of validating a |
|
The callback seam through which the request engine runs queries on a backend. |
|
The results of a query against a backend, as consumed by the entry endpoints. |
|
One entry result: its attribute values plus per-entry envelope data. |
Package Contents¶
- class httk.optimade.model.OptimadeConfig[source]¶
Configuration of a served OPTIMADE database.
implementationextends/overrides the fields of themeta->implementationdictionary (e.g.issue_tracker,source_url,maintainer).database,schema_url, andrequest_delaypopulate the corresponding optionalmetafields (OPTIMADE v1.2+) when set.license,available_licenses, andavailable_licenses_for_entriespopulate the corresponding optional base-info attributes when set.data_availableis filled in byprocess_initwith the number of available entries per entry endpoint.
- exception httk.optimade.model.OptimadeError(message: str, response_code: int, response_message: str, longmsg: str | None = None)[source]¶
Bases:
ExceptionCommon base class for all non-exit exceptions.
- response_code¶
- response_msg¶
- content¶
- exception httk.optimade.model.TranslatorError(message: str, response_code: int, response_message: str, longmsg: str | None = None)[source]¶
Bases:
OptimadeErrorCommon base class for all non-exit exceptions.
- class httk.optimade.model.EndpointResponse[source]¶
A response produced by an endpoint, to be serialized by the web layer.
Either
json_response(a JSON:API document) orcontent(a raw body) is set.
- class httk.optimade.model.RawRequest[source]¶
An incoming OPTIMADE request, as handed over by the web layer.
Only
baseurlandrepresentationare mandatory; missing information is derived fromrepresentationduring validation.
- class httk.optimade.model.ValidatedParameters[source]¶
Validated URL query parameters of an OPTIMADE request.
- dimension_slices: dict[str, RequestedSlice]¶
- class httk.optimade.model.ValidatedRequest[source]¶
The result of validating a
RawRequest.- query: ValidatedParameters¶
- class httk.optimade.model.QueryFunction[source]¶
Bases:
ProtocolThe callback seam through which the request engine runs queries on a backend.
- class httk.optimade.model.QueryResults[source]¶
Bases:
ProtocolThe results of a query against a backend, as consumed by the entry endpoints.
Iteration yields one
ResultRowper entry; itsvaluesmap OPTIMADE response-field names to values, and theidandtypekeys are always present.