httk.serve.optimade.client

Synchronous, read-only discovery for remote OPTIMADE services.

This module establishes lossless schema snapshots and strict definition-IRI recognition. Query construction and paginated execution live in remote_query and are imported lazily by OptimadeStore.searcher().

Attributes

Exceptions

OptimadeClientError

Base class for safe, client-side OPTIMADE failures.

OptimadeTransportError

The HTTP client could not complete a request.

OptimadeHTTPError

A remote endpoint returned a non-success HTTP status.

OptimadeErrorDocumentError

A non-success response supplied a parseable OPTIMADE errors document.

OptimadeDiscoveryError

An /info document was malformed or inconsistent for discovery.

OptimadeVersionNegotiationError

An OPTIMADE base URL could not be negotiated to a supported API version.

Classes

RemoteEntryType

One immutable remote entry endpoint discovered from /info.

OptimadeStore

A synchronous read-only OPTIMADE service connection with eager discovery.

Module Contents

httk.serve.optimade.client.ALL_ADVERTISED[source]
exception httk.serve.optimade.client.OptimadeClientError[source]

Bases: RuntimeError

Base class for safe, client-side OPTIMADE failures.

exception httk.serve.optimade.client.OptimadeTransportError(source_url: str, detail: str)[source]

Bases: OptimadeClientError

The HTTP client could not complete a request.

source_url[source]
detail[source]
exception httk.serve.optimade.client.OptimadeHTTPError(source_url: str, status_code: int, detail: str | None = None)[source]

Bases: OptimadeClientError

A remote endpoint returned a non-success HTTP status.

source_url[source]
status_code[source]
detail = None[source]
exception httk.serve.optimade.client.OptimadeErrorDocumentError(source_url: str, status_code: int, detail: str | None = None)[source]

Bases: OptimadeHTTPError

A non-success response supplied a parseable OPTIMADE errors document.

exception httk.serve.optimade.client.OptimadeDiscoveryError(source_url: str, detail: str)[source]

Bases: OptimadeClientError

An /info document was malformed or inconsistent for discovery.

source_url[source]
detail[source]
exception httk.serve.optimade.client.OptimadeVersionNegotiationError(source_url: str, detail: str)[source]

Bases: OptimadeClientError

An OPTIMADE base URL could not be negotiated to a supported API version.

source_url[source]
detail[source]
class httk.serve.optimade.client.RemoteEntryType[source]

One immutable remote entry endpoint discovered from /info.

name is solely the service’s transport endpoint name. Semantic recognition is intentionally represented by binding and is derived exclusively from definition IRIs.

name: str[source]
definition_id: str | None[source]
schema: httk.core.OptimadeSchemaSnapshot[source]
property_iris: collections.abc.Mapping[str, str][source]
property_names: collections.abc.Mapping[str, str][source]
property_types: collections.abc.Mapping[str, tuple[str, str | None]][source]
advertised_properties: tuple[str, Ellipsis][source]
default_response_properties: tuple[str, Ellipsis][source]
sortable_properties: tuple[str, Ellipsis][source]
binding: httk.core.OptimadeEntryBinding | None[source]
backend: type[source]
class httk.serve.optimade.client.OptimadeStore(base_url: str, *, client: object | None = None, page_limit: int = 100, max_pages: int = 10000, allow_cross_origin_pagination: bool = False, response_fields: object | None = None)[source]

A synchronous read-only OPTIMADE service connection with eager discovery.

requested_base_url[source]
base_url[source]
page_limit = 100[source]
max_pages = 10000[source]
allow_cross_origin_pagination = False[source]
response_fields = None[source]
api_version: str | None = None[source]
property entry_types: tuple[RemoteEntryType, Ellipsis][source]

Discovered entry endpoints in the service-advertised order.

property entry_types_by_name: collections.abc.Mapping[str, RemoteEntryType][source]

An immutable transport-name lookup for entry_types.

entry_type(name: str) RemoteEntryType[source]

Return one discovered endpoint by its transport name.

refresh() None[source]

Atomically replace discovery state after a fully successful rediscovery.

close() None[source]

Close an internally owned HTTP client; borrowed clients stay open.

searcher(*, response_fields: object = ...) httk.serve.optimade.remote_query.RemoteSearcher[source]

Create one synchronous, read-only remote search plan.

Passing response_fields overrides the store-level selection. An omitted value inherits it, while explicit None requests the service default.