Generate lookml view files from dbt models
Project description
dbt2looker
Use dbt2looker
to generate Looker view files automatically from dbt models.
Features
- Column descriptions synced to looker
- Dimension for each column in dbt model
- Dimension groups for datetime/timestamp/date columns
- Measures defined through dbt column
metadata
see below - Looker types
- Warehouses: BigQuery, Snowflake, Redshift (postgres to come)
Quickstart
Run dbt2looker
in the root of your dbt project after compiling looker docs.
Generate Looker view files for all models:
dbt docs generate
dbt2looker
Generate Looker view files for all models tagged prod
dbt2looker --tag prod
Install
Install from PyPi repository
Install from pypi into a fresh virtual environment.
# Create virtual env
python3.7 -m venv dbt2looker-venv
source dbt2looker-venv/bin/activate
# Install
pip install dbt2looker
# Run
dbt2looker
Build from source
Requires poetry and python >=3.7
# Install
poetry install
# Run
poetry run dbt2looker
Defining measures
You can define looker measures in your dbt schema.yml
files. For example:
models:
- name: pages
columns:
- name: url
description: "Page url"
- name: event_id
description: unique event id for page view
meta:
looker.com: # looker config block for column
measures:
- name: Page views
type: count
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dbt2looker-0.6.2.tar.gz
(13.7 kB
view hashes)
Built Distribution
dbt2looker-0.6.2-py3-none-any.whl
(14.4 kB
view hashes)
Close
Hashes for dbt2looker-0.6.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 084113a57abd509d973c3eb7dbf1e0fc95956e5e9aaa2ed8e15f630655a6a2d4 |
|
MD5 | a02904200ee3b7d5ef2ef3f0a97cd2d2 |
|
BLAKE2b-256 | d45e2921ac9cce76cd7cfbd7a31272e1c5be04b16f83b642500f7ea1a57f8734 |