Generate lookml view files from dbt models
Project description
dbt2looker
Use dbt2looker
to generate Looker view files automatically from dbt models.
Want a deeper integration between dbt and your BI tool? You should also checkout Lightdash - the open source alternative to Looker
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
For development, it is recommended to use python 3.7:
# Ensure you're using 3.7
poetry env use 3.7
# alternative: poetry env use /usr/local/opt/python@3.7/bin/python3
# Install dependencies and main package
poetry install
# Run dbtlooker in poetry environment
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:
measures:
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
Built Distribution
File details
Details for the file dbt2looker-0.8.2.tar.gz
.
File metadata
- Download URL: dbt2looker-0.8.2.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.7.11 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b12f0d36cb9926e910ed677e56c3635fcae269a6998ee670f4148f2670d81e9d |
|
MD5 | b099fd48ed6584b948d6167f65076a99 |
|
BLAKE2b-256 | f5d1da03a53a7a8e2686a5bcee1008d0792617b3a78fc2f87d865b007112c373 |
File details
Details for the file dbt2looker-0.8.2-py3-none-any.whl
.
File metadata
- Download URL: dbt2looker-0.8.2-py3-none-any.whl
- Upload date:
- Size: 24.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.7.11 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0ad8b69422ee9b0d80450369fd502845ae0d29b0e5fee538724b45b21d686d5 |
|
MD5 | 8f9598c39607e834ea00808894dc822e |
|
BLAKE2b-256 | 77c7118d18c2e611a797d7f5fe6d13c37f2e81828ac1f512346d6ff8a4e3d5d8 |