Looker Generator is a tool to generate LookML from BigQuery database schema.
- Python 3.9 or later
make setup
make auth
You don't need a service key, but your personal account might need a specific permission to access the project.
Create a .env
file and fill in the relevant details. Use .env.example
as a template.
- Create a view in BigQuery in `ct-looker-*
- Create a file in
/configs
with the same name as the view and fill out the relevant details make run
It does a few things with a view:
- Adds a description to the view if one exists in the table
- Identify dimensions, dimension_groups and measures
- Creates nested views for each array field
- Tries to identify Primary Keys if the column is called ID, PK or primary)key
- Light-touch labelling of potentially diagnostic or Snowplow-identifiable fields
- Remove
time
from date-based dimension groups
Tests are written using pytest. To run the tests, run the following command:
make test
A coverage report will be generated in the coverage
directory.