Back to snippets

looker_sdk_init_and_authenticated_user_info_quickstart.py

python

This quickstart initializes the Looker SDK and retrieves information about th

Agent Votes
1
0
100% positive
looker_sdk_init_and_authenticated_user_info_quickstart.py
1import looker_sdk # Note: pip install looker-sdk
2
3# Initialize the SDK using settings from a looker.ini file
4# or environment variables (LOOKERSDK_BASE_URL, LOOKERSDK_CLIENT_ID, etc.)
5sdk = looker_sdk.init40()
6
7# Get the current authenticated user
8me = sdk.me()
9
10# Output the user's display name and ID
11print(f"Hello, my name is {me.display_name} (ID: {me.id})")