lkml
A speedy LookML parser implemented in pure Python.
What it is and what it does
lkml is a pure-Python LookML parser and serializer for Looker configuration files. It reads LookML text into Python dictionaries or JSON and writes Python objects back out as LookML syntax. The package has no external dependencies and is designed for speed—typical view or model files parse in under 10 milliseconds (excluding I/O). It is tested against over 160K lines of real LookML from public repositories.
You would use lkml when you need to programmatically read, transform, or generate Looker model and view definitions. Common scenarios include migrating Looker configurations, validating LookML syntax, generating models from templates, or integrating Looker definitions into a larger data pipeline or CI/CD workflow.
Use it for:
- Validate or lint LookML files by parsing them and checking structure or naming conventions.
- Generate LookML model and view definitions programmatically from Python data structures or templates.
- Migrate or transform Looker configurations by reading, modifying, and rewriting LookML files.
- Integrate Looker metadata into documentation or data catalog systems by parsing model definitions.
- Build CI/CD checks that verify LookML syntax or consistency before deployment.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses LookML strings into Python objects or JSON and serializes Python objects back to LookML strings, with no external dependencies.
Yes. lkml is a stable, well-tested, dependency-free parser for a specific and narrow task (LookML serialization). It has no known vulnerabilities, permissive licensing, and low install friction. Dormant maintenance is acceptable for a mature, focused tool. Install it if you need to parse or generate LookML programmatically.
Install
lkml on PyPI
pip
pip install lkmluv
uv add lkmlpoetry
poetry add lkmlInstalling lkml
Before you install
Low install friction—pure Python with no runtime dependencies. Dormant maintenance (last release 2025-01-31, 560 days ago), but the package is marked Production/Stable and has not been archived.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package with minimal restrictions, provided you include the license notice.
Quickstart
pip install lkml
import lkml
# Parse LookML string to Python dict
model_dict = lkml.load('view: my_view { dimension: id { type: number } }')
# Serialize Python dict back to LookML string
lookml_str = lkml.dump(model_dict)
Verify before relying
- Whether the parser handles all LookML syntax variations in active use beyond the 160K lines tested on GitHub.
- Performance characteristics on very large or deeply nested LookML structures.
- Python version support beyond 3.7 (requires_python is unspecified in the fact sheet).
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 560 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,309,583/month — #4,076 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: lkml-1.3.7-py2.py3-none-any.whl
Keywords: lookml, looker, parser
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
looker-sdkProvides a Python client library for…
permissive · top 5,000 on PyPI
sexpdataParses and serializes S-expressions (Lisp-style…
permissive · top 15,000 on PyPI
rtomlrtoml parses and serializes TOML files and…
permissive · top 5,000 on PyPI
rapidyamlParses and emits YAML documents via a fast C++…
permissive · top 15,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
serpentSerpent serializes Python objects to…
permissive · top 15,000 on PyPI
xsdataxsdata generates Python dataclasses from XML…
permissive · top 5,000 on PyPI
pymzmlpymzml parses mzML mass spectrometry data files…
permissive · top 15,000 on PyPI
tomliTomli parses TOML configuration files and…
permissive · top 1,000 on PyPI
tomli-wTomli-W serializes Python dictionaries to TOML…
permissive · top 1,000 on PyPI