-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathget_look.py
More file actions
36 lines (22 loc) · 700 Bytes
/
get_look.py
File metadata and controls
36 lines (22 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import yaml ### install the pyyaml package
from lookerapi import LookerApi
from datetime import datetime
from pprint import pprint
### ------- HERE ARE PARAMETERS TO CONFIGURE -------
look_to_get = 123
host = 'localhost'
### ------- OPEN THE CONFIG FILE and INSTANTIATE API -------
f = open('config.yml')
params = yaml.load(f)
f.close()
my_host = params['hosts'][host]['host']
my_secret = params['hosts'][host]['secret']
my_token = params['hosts'][host]['token']
looker = LookerApi(host=my_host,
token=my_token,
secret = my_secret)
### ------- GET AND PRINT THE LOOK -------
data = looker.get_look()
pprint(data)
### ------- Done -------
print "Done"