looker-sdk 25.16.0


pip install looker-sdk

  Latest version

Released: Sep 17, 2025

Project Links

Meta
Author: Looker Data Sciences, Inc.
Requires Python: >=3.6

Classifiers

The Looker SDK for Python provides a convenient way to communicate with the Looker API available on your Looker server. The library requires python3.6+ and is annotated using the typing module.

The SDK uses a plug-in architecture (also known as dependency injection) for initializing that supports run-time specific transports (currently only RequestsTransport) and different approaches for managing API authentication (AuthSession and OAuthSession). The methods and models are generated from the Looker API spec by a new code generator developed at Looker.

Please report any issues encountered, and indicate the SDK language in the report.

Basic Usage

import looker_sdk

# For this to work you must either have set environment variables or created a looker.ini as described below in "Configuring the SDK"
sdk = looker_sdk.init40()  # or init31() for the older v3.1 API
my_user = sdk.me()

# output can be treated like a dictionary
print(my_user["first_name"])
# or a model instance (User in this case)
print(my_user.first_name)

# input methods can take either model instances like WriteUser
sdk.create_user(
    body=looker_sdk.models.WriteUser(first_name="Jane", last_name="Doe")
)
# or plain dictionaries
sdk.create_user(body={"first_name": "Jane", "last_name": "Doe"})

Full tutorial

Go from installation all the way to creating a functional micro-application in this 20-30 minute interactive tutorial.

This tutorial is hosted in Google Colaboratory, an interactive online notebook. You can follow along right in the notebook by clicking the button below.

https://colab.research.google.com/assets/colab-badge.svg

Sample project setup

Install python 3.8. We highly recommend using pyenv to install different versions of python. Mac users should use homebrew to install pyenv:

brew install pyenv

Linux users should use

curl https://pyenv.run | bash

Put this in your shell configuration script:

export PATH=$PATH:$HOME/.pyenv/bin
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

Follow the remaining steps 3 - 5 of https://github.com/pyenv/pyenv#basic-github-checkout otherwise your python3.8 installation may break.

Now you’re ready to install python 3.8:

pyenv install 3.8.2

We’ll use pipenv (fantastic virtualenv manager) to manage project dependencies.

brew install pipenv

Create a project directory

mkdir looker-sdk-example

Set python3.8 as the base interpreter for this directory

cd looker-sdk-example/
pyenv local 3.8.2

Install looker_sdk using pipenv

pipenv --python 3.8.2 install --pre looker_sdk

Configuring the SDK

The SDK supports configuration through

  1. an .ini file on disk

  2. setting environment variables

  3. providing your own implementation of the ApiSettings class

. The latter override the former.

Note: The .ini configuration for the Looker SDK is a sample implementation intended to speed up the initial development of python applications using the Looker API. See this note on Securing your SDK Credentials for warnings about using .ini files that contain your API credentials in a source code repository or production environment.

In order to configure the SDK client, create a “looker.ini” file to reference during client.setup()

example file:

[Looker]
# Base URL for API. Do not include /api/* in the url. If hosted on GCP, remove the :19999 leaving just https://your.cloud.looker.com
base_url=https://your.looker.com:19999
# API 3 client id
client_id=YourClientID
# API 3 client secret
client_secret=YourClientSecret
# Set to false if testing locally against self-signed certs. Otherwise leave True
verify_ssl=True

Note: If the application using the Looker SDK is going to be committed to a version control system, be sure to ignore the looker.ini file so the API credentials aren’t unintentionally published.

For any .ini setting you can use an environment variable instead. It takes the form of LOOKERSDK_<UPPERCASE-SETTING-FROM-INI> e.g. LOOKERSDK_CLIENT_SECRET

A final option is to provide your own implementation of the ApiSettings class. It is easiest to subclass api_settings.ApiSettings and override the read_config function (don’t forget a call to super().read_config() if appropriate, Example below). However, at a minimum your class must implement the api_settings.PApiSettings protocol.

import os
import looker_sdk
from looker_sdk import api_settings

class MyApiSettings(api_settings.ApiSettings):
    def __init__(self, *args, **kw_args):
        self.my_var = kw_args.pop("my_var")
        super().__init__(*args, **kw_args)

    def read_config(self) -> api_settings.SettingsConfig:
        config = super().read_config()
        # See api_settings.SettingsConfig for required fields
        if self.my_var == "foo":
            config["client_id"] = os.getenv("FOO_CLIENT")
            config["client_secret"] = os.getenv("FOO_SECRET")
        else:
            config["client_id"] = os.getenv("BAR_CLIENT")
            config["client_secret"] = os.getenv("BAR_SECRET")
        return config

sdk = looker_sdk.init40(config_settings=MyApiSettings(my_var="foo"))
...

Code example

See many python sdk examples in our examples repo

Changelog

Located in our github repo

25.16.0 Sep 17, 2025
25.10.0 Jun 20, 2025
25.8.0 May 19, 2025
25.6.0 May 05, 2025
25.4.0 Mar 12, 2025
25.2.0 Feb 07, 2025
25.0.1 Feb 06, 2025
25.0.0 Jan 13, 2025
24.20.0 Nov 07, 2024
24.18.1 Oct 21, 2024
24.18.0 Oct 11, 2024
24.16.2 Sep 16, 2024
24.16.1 Sep 14, 2024
24.16.0 Sep 11, 2024
24.14.0 Aug 12, 2024
24.12.1 Jul 29, 2024
24.12.0 Jul 15, 2024
24.10.0 Jun 12, 2024
24.8.0 May 07, 2024
24.4.0 Apr 05, 2024
24.2.1 Mar 12, 2024
24.2.0 Feb 21, 2024
24.0.0 Feb 03, 2024
23.20.1 Dec 20, 2023
23.20.0 Nov 30, 2023
23.18.0 Nov 22, 2023
23.16.0 Sep 21, 2023
23.14.1 Aug 16, 2023
23.12.0 Jul 17, 2023
23.10.0 Jun 15, 2023
23.8.1 May 11, 2023
23.8.0 May 11, 2023
23.6.0 Apr 11, 2023
23.4.0 Apr 03, 2023
23.2.0 Mar 02, 2023
23.0.0 Feb 22, 2023
22.20.0 Nov 10, 2022
22.18.0 Oct 17, 2022
22.16.0 Sep 21, 2022
22.14.0 Sep 21, 2022
22.12.1 Sep 21, 2022
22.10.0 Jul 14, 2022
22.8.0 Jul 14, 2022
22.6.0 Jul 13, 2022
22.4.0 Mar 24, 2022
22.2.1 Mar 04, 2022
22.2.0 Feb 23, 2022
22.0.0 Feb 15, 2022
21.20.0 Nov 10, 2021
21.18.0 Oct 25, 2021
21.16.0 Oct 19, 2021
21.14.0 Sep 01, 2021
21.12.2 Aug 11, 2021
21.12.1 Aug 09, 2021
21.10.1 Jul 28, 2021
21.10.0 Jul 08, 2021
21.8.1 Jul 07, 2021
21.8.0 Jun 17, 2021
21.6.1 Jun 16, 2021
21.6.0 May 05, 2021
21.4.1 Apr 16, 2021
21.4.0 Apr 02, 2021
21.0.0 Mar 23, 2021
7.20.0 Feb 09, 2021
0.1.3b20 Nov 06, 2020
0.1.3b19 Oct 09, 2020
0.1.3b18 Oct 08, 2020
0.1.3b17 Sep 30, 2020
0.1.3b16 Sep 22, 2020
0.1.3b15 Jul 09, 2020
0.1.3b14 Jun 09, 2020
0.1.3b13 May 28, 2020
0.1.3b12 May 15, 2020
0.1.3b11 May 13, 2020
0.1.3b10 Apr 03, 2020
0.1.3b8 Feb 27, 2020
0.1.3b7 Feb 01, 2020
0.1.3b6 Jan 16, 2020
0.1.3b5 Dec 18, 2019
0.1.3b4 Oct 08, 2019
0.1.3b3 Sep 30, 2019
0.1.3b2 Sep 30, 2019
0.1.3b1 Sep 24, 2019

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras: None
Dependencies:
requests (>=2.22)
typing-extensions (>=4.1.1)
attrs (>=20.1.0)
cattrs (>=1.3)