Skip to main content

Generate lookml view files from dbt models for Bigquery

Project description

dbt2looker

Use dbt2looker-bigquery to generate Looker view files automatically from dbt models in Bigquery.

This is a fork of dbt2looker that is specific to bigquery. The intention is to allow one to define most of the simple and tedious lookml settings in dbt. That way the lookml code gets less bloated, and can be more focused on advanced metrics and explores.

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
  • Define Dimensions define common lookml settings in dbt like label, group label, hidden
  • Opinionated Primary key automatically set the first column to be the primary key, and hide it.
  • Dimension groups for datetime/timestamp/date columns
  • Measures defined through dbt column metadata see below
  • Looker types
  • Warehouses: BigQuery

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-bigquery

# 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:
            looker_measures:
              type: count_distinct
              type: count

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbt2looker-bigquery-0.12.0b8.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

dbt2looker_bigquery-0.12.0b8-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file dbt2looker-bigquery-0.12.0b8.tar.gz.

File metadata

File hashes

Hashes for dbt2looker-bigquery-0.12.0b8.tar.gz
Algorithm Hash digest
SHA256 05a2727f693fec8d6540378edbd8f581ba174f98e189f5e41e23aa18b353415b
MD5 479710053be3e57ba21b3ab96726c92c
BLAKE2b-256 bdbd86662c9fb7d723bfcda3c0380f9746cdcf7f9387bf97b57501166238922d

See more details on using hashes here.

File details

Details for the file dbt2looker_bigquery-0.12.0b8-py3-none-any.whl.

File metadata

File hashes

Hashes for dbt2looker_bigquery-0.12.0b8-py3-none-any.whl
Algorithm Hash digest
SHA256 8e6404259f8eeb9743da06982ab60b6366d928b827b504a99c41bf300948850e
MD5 d28bb22f764036113fc9fc6f425a736d
BLAKE2b-256 079eac5dceb3aad5abf3f055354dce4773bd25aef2f5b1c13a6f904950af0ffc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page