def api_client(token): host = 'https://api-invest.tinkoff.ru/openapi/' conf = Configuration(host=host) conf.access_token = token return OpenApi(ApiClient(configuration=conf))
def sandbox_api_client(token): sandbox_host = 'https://api-invest.tinkoff.ru/openapi/sandbox/' conf = Configuration(host=sandbox_host) conf.access_token = token return SandboxOpenApi(ApiClient(configuration=conf))