looker-open-source / pylookml

A pythonic api for automatic lookml
https://pylookml.readthedocs.io/en/latest/introduction.html
MIT License
45 stars 23 forks source link

Model file parsing by pylookml #40

Closed rchakravorty closed 3 years ago

rchakravorty commented 3 years ago

I am currently looking on views creation by pylookml and I have successfully created .view files with pylookml. In order to expose these views as explores I am not getting any documentation of working with looker model via pylookml. Please suggest

russlooker commented 3 years ago

sorry for the slow reply, just finished a major rewrite. run a pip uninstall lookml pip install lookml then after you've connected to your project you can run:

modelFile = proj.file('my_model.model.lkml') 
for e in modelFile.explores:
    print(e)
modelFile + 'explore: foo {}'

etc Let me know how it goes!