I’d like to announce the release of pyLookML, the batteries included toolkit for scripting LookML.
It leverages the awesome lkml parser written by Josh Temple, but expands on it by offering an OO interface, integration with github or any git service, scripting syntax, convenience functions / macros, querying views for fields with specific parameter conditions, child-dependency tracing and more.
You can get started by doing
pip install lookml (create it in a virutalenv of course!)
Visit the project documentation here
Here is an example script solving the age old EAV schema issue: here
Here is a short cookbook of things you can do with it: here
And of course, let me know if you have any questions!
File bugs and feature requests here
Here is a small code sample demonstrating some of what’s possible:
proj = lookml.Project(
#Optional args for the deploy URL (for deploying directly to production mode)
viewFile = proj.file('01_order_items.view.lkml')
order_items = viewFile.views.order_items
for field in order_items.sale_price.children():
order_items.id.primary_key = 'no'
#writes back to github
#hits the deploy url
Will follow up here with additional recipes and blocks over time you can start adding to your workflows!