mkt.databases.api_schema.APIClient

class mkt.databases.api_schema.APIClient[source]

Bases: object

Base class for API clients.

__init__() None

Methods

__eq__(other)

Return self==value.

__init__()

_stamp_from_response(res)

Record query datetime + cache provenance from a requests-cache response.

_stamp_now()

Record current UTC datetime; cache provenance unknown.

check_response(res)

Check the response status code for errors.

Attributes

__dataclass_fields__

__dataclass_params__

__match_args__

from_cache

Whether the most recent response was served from requests-cache.

query_datetime

UTC datetime the underlying network query was made (cache creation time if served from cache).

__init__() None
_stamp_from_response(res: Response) None[source]

Record query datetime + cache provenance from a requests-cache response.

Parameters:

resrequests.Response

Response object from a requests-cache CachedSession; falls back to current UTC time if the response lacks requests-cache metadata.

_stamp_now() None[source]

Record current UTC datetime; cache provenance unknown.

For clients that bypass requests-cache (e.g., bravado SwaggerClient), this records when the query ran but cannot determine if a cached layer was hit.

static check_response(res: Response) None[source]

Check the response status code for errors.

from_cache: bool | None = None

Whether the most recent response was served from requests-cache.

query_datetime: datetime | None = None

UTC datetime the underlying network query was made (cache creation time if served from cache).