Package: lookml-tools
OverviewLookML ToolsThis repository contains some tools to handle best practices of a set of developers working on LookML files.There are three tools:LookML updaterLookML linterLookML grapherSites:source:https://github.com/ww-tech/lookml-toolsdocumentation:https://ww-tech.github.io/lookml-tools/Pypi:https://pypi.org/project/lookml-tools/LookML updaterThe first tool helps solve a problem of official definitions ofdimensionsandmeasures—such as in a business glossary—getting out of sync from some other system. The solution implemented here is to have a remote master list whose definitions are propagated to LookML. Thus, given some remote definition for a given LookMLdimension,dimension_group, ormeasure, inject it in the LookML.Full documentation ishere.LookML linterThe second tool helps us check that our LookML conforms to some given coding standards and LookML developer best practices. It runs a series of checks over our LookML files and reports whichfiles, or whichdimensions,dimension_groups, ormeasures, fail those checks.Full documentation ishere.LookML grapherThe third tool creates a "network diagram" of themodel - explore - viewrelationships and writes to anPNGimage file. The code will also identify anyorphansi.e. views not referenced by any models or explores.Full documentation ishere.InstallationFor the grapher, you will need to install grapviz:brew install graphvizFor all tools, you will need to install dependencies:pip install -r requirements.txtYou can install the Python codebase oflookml-toolsvia pip:pip install lookml-toolsOne user reported having to install a specific version of pandas (pandas==0.24.0) to make this all work. YMMV.Alternatively, you can install withpython setup.py installUnit testsThere is a test suite with close to 100% code coverageRun withpip install pytest-cov

python -m pytest --cov=lkmltools/ test/*.py ; coverage htmlDeveloper NotesThere are some developer notes for the linterhere.ContributeWe would love to have your feedback, suggestions, and especially contributions to the project. Create a pull request!You can reach me directly atcarl.anderson@weightwatchers.comas well as@leapingllamason Twitter.Release notes2019-10-30: 2.0.5added Travis CI config2019-10-19: 2.0.4pandas version change to support Python 3.7 (seehttps://github.com/ww-tech/lookml-tools/pull/5)
Thanks for your contributionhttps://github.com/m-deck!Grapher: title now exposed as an optionGrapher can now create animated GIFs2019-09-28: 2.0.3setup.py now uses find_packages()2019-09-28: 2.0.2Added missinginit.py so that packages are recognized2019-07-17: 2.0.1Adding missinglkmltorequirements.txt2019-07-17: 2.0.0Given the impact of the following two changes, this is a major release:swapped out the node-based LookML parser withJosh Temple'snew Python lkml parser (https://pypi.org/project/lkml/). This simplifies install, dependency management, and underlying parsed JSON format.added layer of abstraction viaLookMLandLookMLFieldclasses so that rules and other code can query LookML attributes via methods instead of inspecting raw JSON.Other changes:lkmltools.RuleFactoryis now a singleton so it is easier for users to register their own rules.Can now parameterize any rule in the configuration by adding additional keys to the dictionary for that rule.
For instance, if the config defines{"name": "MyAwesomeRule", "run": true, "debug": true, "strict_mode":true, length: 6}then this whole dictionary is passed into the constructor during rule instantiation.2019-06-10: 1.0.0initial releaseLicenseCopyright 2019 WW International, Inc.Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.