Metadata-Version: 2.1
Name: dbt-quicksight-lineage
Version: 0.3.0
Project-URL: Documentation, https://github.com/mashiike/dbt-quicksight-lineage#readme
Project-URL: Issues, https://github.com/mashiike/dbt-quicksight-lineage/issues
Project-URL: Source, https://github.com/mashiike/dbt-quicksight-lineage
Author-email: mashiike <ikeda-masashi@kayac.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.10
Requires-Dist: boto3~=1.26.164
Requires-Dist: click~=8.1.3
Requires-Dist: colorlog~=6.7.0
Requires-Dist: dbt-core==1.5.*
Requires-Dist: ruamel-yaml~=0.17.32
Description-Content-Type: text/markdown

# dbt_quicksight_lineage

[![PyPI - Version](https://img.shields.io/pypi/v/dbt-quicksight-lineage.svg)](https://pypi.org/project/dbt-quicksight-lineage)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dbt-quicksight-lineage.svg)](https://pypi.org/project/dbt-quicksight-lineage)

-----
PyPI: https://pypi.org/project/dbt-quicksight-lineage/
Target DBT Version: 1.5.*

**Table of Contents**

- [Installation](#installation)
- [License](#license)

## Installation

```console
pip install dbt-quicksight-lineage
```

## Usage

```console
Usage: dbt-quicksight-lineage [OPTIONS] COMMAND [ARGS]...

  dbt-quicksight-lineage: DBT to QuickSight Lineage command helper

Options:
  --version                       Show the version and exit.
  --log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL]
                                  Set log level
  --no-color / --color            Disable color in output
  -h, --help                      Show this message and exit.

Commands:
  init             Modify schema.yml to add QuickSight metadata with Data...
  update-data-set  Update QuickSight DataSet from DBT Manifest
```

### QuickStart

```console
dbt-quicksight-lineage init --project-dir /path/to/dbt/project --data-set-id <data-set-id>
```

modify your `schema.yml` to add QuickSight metadata with Data Lineage

for example:
```yaml
version: 2

models:
  - name: my_first_dbt_model
    description: "A starter dbt model"
    meta:
      quicksight:
        logical_table_name: My First DBT Model
        data_sets:
          - id: 00000000-0000-0000-0000-000000000000
            data_source_arn: arn:aws:quicksight:ap-northeast-1:123456789012:datasource/00000000-0000-0000-0000-000000000000
        folders:
          - name: Key
            description: "this is Key folder, must distinct counts"
          
    columns:
      - name: id
        description: "The primary key for this table"
        meta:
          quicksight:
            field_name: ID
            folder: Key
            data_type: string
        tests:
          - unique
          - not_null
      - name: geo
        description: "City name of geometry"
        meta:
          quicksight:
            geographic_role: city 
            field_name: Geometry
            folder: Key
      - name: hidden_value
        meta:
          quicksight:
            hidden: true

  - name: my_second_dbt_model
    description: "A starter dbt model"
    columns:
      - name: id
        description: "The primary key for this table"
        tests:
          - unique
          - not_null
```

and update data set
```console
dbt-quicksight-lineage update-data-set --project-dir /path/to/dbt/project --data-set-id <data-set-id>
```

![image](docs/images/dataset.png)

## License

`dbt-quicksight-lineage` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
