Skip to main content

A tool for dbt column lineage

Project description

dbt-column-lineage

This is a tool to visualize the colulmn level lineage of dbt models. It uses the manifest.json and catalog.json files generated by dbt to create a graph of the lineage of the models. It is a web application that uses a Flask backend and a Next.js frontend.

PyPI - Version PyPI - Python Version PyPI - Downloads PyPI - License

quickstart

Install dbt-column-lineage using pip:

pip install dbt-column-lineage

Run the following command:

# go to your dbt project directory
cd your-dbt-project/

# edit your model file
vi models/test.sql

# generate the manifest.json and catalog.json files
dbt docs generate 

# set the environment variable for the dialect you are using
export SQLGLOT_DIALECT=snowflake

# Launch dbt-column-lineage with test.sql as the initial model
dbt-coloumn-lineage run-params

development

To develop the application, you will need to run the backend and frontend separately.

git clone git@github.com:Oisix/dbt-column-lineage.git
cd dbt-column-lineage

for backend

activate venv and run the following commands:

python3 -m venv venv
source venv/bin/activate

pip install --upgrade pip
pip install -r requirements.txt

uvicorn --app-dir src dbt_column_lineage.main:app --port=5000 --reload

for frontend

run the following commands:

npm install
npm run dev

after the frontend is running, Let's access http://localhost:3000

for Looker integration (optional)

If you want to integrate with Looker, you can use the following commands:

# set the environment variables
export LOOKERSDK_CLIENT_ID=(your client id)
export LOOKERSDK_CLIENT_SECRET=(your client secret)
export LOOKERSDK_BASE_URL=(your looker base url)
export LOOKER_IGNORE_FOLDERS=(comma separated list of folders to ignore)
export LOOKER_IGNORE_ELEMENTS=(comma separated list of dashboard elements to ignore)

# it analyze the looker models, target/dashboad_analysis.json will be created
python tools/looker_analyzer.py

# rerun the backend
uvicorn --app-dir src dbt_column_lineage.main:app --port=5000 --reload

for Google OAuth login test (optional)

If you want to test the OAuth login, you can use the following commands:

export GOOGLE_CLIENT_ID=(your client id)
export GOOGLE_CLIENT_SECRET=(your client secret)
docker build -t test .
docker run -p 5000:5000 -e USE_OAUTH=true -e GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID -e GOOGLE_CLIENT_SECRET=$GOOGLE_CLIENT_SECRET -e DEBUG_MODE=true test

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

dbt_column_lineage-0.5.26.tar.gz (889.0 kB view details)

Uploaded Source

Built Distribution

dbt_column_lineage-0.5.26-py3-none-any.whl (793.9 kB view details)

Uploaded Python 3

File details

Details for the file dbt_column_lineage-0.5.26.tar.gz.

File metadata

  • Download URL: dbt_column_lineage-0.5.26.tar.gz
  • Upload date:
  • Size: 889.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for dbt_column_lineage-0.5.26.tar.gz
Algorithm Hash digest
SHA256 7b80911a91bd98736ad1d07e2747f07f7741834396d11f120b1610aab5e7456a
MD5 b6167a244361572804c174bfeae6dfa0
BLAKE2b-256 d085995357c71f49597ae2f62c6839459bd18ebe512ffbacd8c42e576479f8ed

See more details on using hashes here.

File details

Details for the file dbt_column_lineage-0.5.26-py3-none-any.whl.

File metadata

File hashes

Hashes for dbt_column_lineage-0.5.26-py3-none-any.whl
Algorithm Hash digest
SHA256 c5796b540556c30f768b3228534f3251f8b0fd135bbd4cc3310e2afa9a0ac543
MD5 323b99c0e535d9f73d549bff289c0bba
BLAKE2b-256 63ed2f4aa656ac88f89251a98cc2690136d6b5bd63b7304039f0c88a0bbfc7c6

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