Skip to main content

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)

demo

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


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.8.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

dbt2looker-0.8.0-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file dbt2looker-0.8.0.tar.gz.

File metadata

  • Download URL: dbt2looker-0.8.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.6 Darwin/20.6.0

File hashes

Hashes for dbt2looker-0.8.0.tar.gz
Algorithm Hash digest
SHA256 b3b2eedad6d0ca7d3f65485d984aee9afa9fc94b311e1a11ab30758d9e4f6989
MD5 16de0ced40c5be4907f5e3aab58df8c7
BLAKE2b-256 2bb2a2351de5b9eb0cc82c22d009a5cd8baa95c7d5eab5273668c3838c4b4e26

See more details on using hashes here.

File details

Details for the file dbt2looker-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: dbt2looker-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.6 Darwin/20.6.0

File hashes

Hashes for dbt2looker-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d76229f22eab2b79aa88bb1e874c897d5a32fa7773016f67ba0f772736b420a9
MD5 292c6862c0758b8f0d7a52ab9f1b0a45
BLAKE2b-256 af7bdf6ea67d8e31b75ae2d9a973e001a0681b96f70b1c903f61ef8e403f3a35

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