mkt.databases.open_targets.OpenTargets

class mkt.databases.open_targets.OpenTargets(url: str = 'https://api.platform.opentargets.org/api/v4/graphql', query_string: str | None = None, variables: dict = <factory>, response: dict | None = None)[source]

Bases: GraphQLClient

Open Targets GraphQL API client.

__init__(url: str = 'https://api.platform.opentargets.org/api/v4/graphql', query_string: str | None = None, variables: dict = <factory>, response: dict | None = None) None

Methods

__eq__(other)

Return self==value.

__init__([url, query_string, variables, ...])

__post_init__()

Initialize the GraphQL API client.

_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.

query_api()

Query a GraphQL API and return result.

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).

query_string

GraphQL query string to be executed.

response

Response from the GraphQL API query, if any.

url

Base URL for the Open Targets GraphQL API.

variables

Variables for the GraphQL query, if any.

__init__(url: str = 'https://api.platform.opentargets.org/api/v4/graphql', query_string: str | None = None, variables: dict = <factory>, response: dict | None = None) None
url: str = 'https://api.platform.opentargets.org/api/v4/graphql'

Base URL for the Open Targets GraphQL API.

variables: dict

Variables for the GraphQL query, if any.