ovok_sdk.ovok

The `Ovok` client, the entry point to every API namespace.

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.25+2ba84b0

The Ovok client, the entry point to every API namespace.

Ovok

Ovok(
    base_url: str,
    tenant_code: str,
    *,
    fhir_path: str = DEFAULT_FHIR_PATH,
    storage: OvokStorage | None = None,
    client_id: str | None = None,
    client_secret: str | None = None,
    transport: Transport | None = None,
    timeout: float = DEFAULT_TIMEOUT_SECONDS,
    max_network_retries: int = DEFAULT_MAX_NETWORK_RETRIES,
    on_unauthenticated: OnUnauthenticated | None = None,
)

One client per tenant; each namespace mirrors an area of the Ovok API.

Without client_secret the client acts for a signed-in user (see auth); with client_id and client_secret it authenticates as a machine client.

Parameters

NameTypeDefaultDescription
base_urlstrAbsolute http(s) URL of the Ovok API, such as https://api.sandbox.ovok.com.
tenant_codestrTenant every request is scoped to.
fhir_pathstrDEFAULT_FHIR_PATHPath of the FHIR API under base_url.
storageOvokStorage | NoneNoneWhere the user session is kept; defaults to MemoryStorage.
client_idstr | NoneNoneApp client ID, used for social sign-in, password resets and machine auth.
client_secretstr | NoneNoneMachine client secret; requires client_id.
transportTransport | NoneNoneSends HTTP requests; defaults to UrllibTransport.
timeoutfloatDEFAULT_TIMEOUT_SECONDSRequest timeout in seconds.
max_network_retriesintDEFAULT_MAX_NETWORK_RETRIESRetries for safe requests that fail on the network.
on_unauthenticatedOnUnauthenticated | NoneNoneCalled with an UnauthenticatedReason when the user is signed out.

Raises

  • OvokConfigError: An option is missing or invalid.

Examples

>>> from ovok_sdk import Ovok
>>> ovok = Ovok("https://api.sandbox.ovok.com", "your-tenant")
>>> page = ovok.slim.patients.list({"count": 20})

Last updated on

On this page