Metadata-Version: 2.1
Name: dbt_column_lineage
Version: 0.5.21
Summary: A tool for dbt column lineage
Author-email: Tomoki Takahashi <takahashi_tomoki@oisixradaichi.co.jp>
Project-URL: Repository, https://github.com/tomoki-takahashi-oisix/dbt-column-lineage
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"

# 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](https://img.shields.io/pypi/v/dbt-column-lineage)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dbt-column-lineage)
![PyPI - Downloads](https://img.shields.io/pypi/dw/dbt-column-lineage)
![PyPI - License](https://img.shields.io/pypi/l/dbt-column-lineage)

# 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 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
```
