Skip to main content

AI-based documentation for dbt-models

Project description

dbt-buddy

Autogenerated documentation for dbt-models using YandexGPT LLM

dbt-buddy is a python package with CLI that allows automatically create YAML-based documenation for existing dbt-model. Built-in method fill_yaml_with_column_description() will add columns description in Russian language using LLM-model YandexGPT.

Prerequisites

  1. You need to create .env file in the dbt-project working directory and add the following secret:
    • API_KEY=<secret key> - required to access YandexGPT API.
    • CATALOG_ID=<catalog identifier> - Yandex Cloud catalog ID is a part of API request.
  2. dbt-buddy uses dbt-macros from dbt-codegen package. It is necessary to install it by simply adding it to project's packages.yml file:
packages:
  - package: dbt-labs/codegen
    version: 0.12.1

Then run command:

$ dbt deps

Available commands

  1. document - generates YAML-based documentation with AI-proposed columms description.

document

You can create documentation by simply running the command:

$ buddy document --model <dbt-model name>

The result will be a text string in the console, formatted in a documentation format acceptable for dbt.

CLI Options

  1. -m <model_name>, --model <model_name>(required). The name of existing dbt-model.
  2. --project-dir. The path to directory with dbt_project.yml. Default is the current working directory.
  3. --profiles-dir. The path to directory with profiles.yml. Default is the current working directory.
  4. -s, --save. If specified, the generated documentation is saved in a YAML-file in the same directory and with the same name as the specified model.
  5. -e, --examples. If specified, YandexGPT will try to add column's possible accepted values (especially relevant if the SQL-query explicitly specifies values with the CASE statement).
  6. -v, --verbose. If specified, the response from the YandexGPT API will be displayed in the console.

You can get the full list of existing options by running the command:

$ buddy document --help

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_buddy-0.0.3.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

dbt_buddy-0.0.3-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file dbt_buddy-0.0.3.tar.gz.

File metadata

  • Download URL: dbt_buddy-0.0.3.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.4

File hashes

Hashes for dbt_buddy-0.0.3.tar.gz
Algorithm Hash digest
SHA256 feab7798e5671911a3fdfd3876b11b3c6d89230ee86021f0f3b6bf802079b553
MD5 4d34f903d35c55b8b756cb9d04d5c95c
BLAKE2b-256 949d16602f300c129ba4ed36ecfd8ea3ba978734e2f1feeaca407f49a177ceb4

See more details on using hashes here.

File details

Details for the file dbt_buddy-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: dbt_buddy-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.4

File hashes

Hashes for dbt_buddy-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ff7a0b8b1030bcb1a966f5b6e3b1a13626a88df9346e0700692cd148d80e77bb
MD5 fb8597266695d5a0b041ce43c4f72bb5
BLAKE2b-256 205581879838c109d284c882d3f0a0e7a956bd91bbe478c839acc170848691b7

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