Skip to main content

CLI for Turbovault 4 DBT

Project description

TurboVault4dbt_cli

TurboVault4dbt Banner


What is TurboVault4dbt_cli?

TurboVault4dbt_cli is an open-source CLI tool that automatically generates dbt models according to datavault4dbt templates. It uses a metadata input of your Data Vault 2.0 from one of the supported databases and creates ready-to-process dbt-models.


Prerequisites


Supported Metadata Sources

  • Snowflake
  • BigQuery
  • Google Sheets
  • Excel
  • SQLite DB Files

How does my metadata needs to look like?

Your metadata needs to be stored in the following tables/worksheets:


Installation (CLI Version)

  1. Clone this repository:
    git clone https://github.com/ScalefreeCOM/turbovault4dbt.git
    cd turbovault4dbt
    
  2. (Recommended) Create and activate a virtual environment:
    python3 -m venv turbovault-env
    source turbovault-env/bin/activate
    
  3. Install in editable mode:
    pip install -e .
    

Quickstart: Using the CLI

1. Prepare your metadata

  • See metadata_ddl/ for DDL scripts and Excel templates.
  • Configure your metadata connection in src/turbovault4dbt/backend/config/config.ini.

2. Run TurboVault4dbt_cli

Basic usage:

# List available nodes from your metadata Excel file
$ turbovault list --file path/to/your.xlsx

# Generate dbt models for selected nodes
$ turbovault run --file path/to/your.xlsx -s hub1

# Use selectors (e.g., +node, node+, @node)
$ turbovault run --file path/to/your.xlsx -s '+sat1 hub2+ @masat3'

# Specify output directory
$ turbovault run --file path/to/your.xlsx --output-dir my_output_dir -s hub1

Command reference:

  • turbovault run --file <input.xlsx> [-s <selector>] [--output-dir <dir>]
    Generate dbt models for selected nodes.
  • turbovault list --file <input.xlsx> [-s <selector>]
    List resolved nodes for a selector (dry run).

Selector syntax:

  • A+ — node A and all descendants
  • +A — node A and all ancestors
  • @A — node A, all ancestors, and all descendants
  • Multiple selectors can be space-separated

Regression Testing

To run the regression test suite:

pip install -r requirements-test.txt
pytest tests/test_regression.py
  • Add new test cases by creating folders in tests/ with input.xlsx and expected_output/.
  • Negative test cases (expected failures) are also supported.

Project Structure

  • src/turbovault4dbt/ — all source code
  • tests/ — regression test cases
  • pyproject.toml, requirements.txt, etc. — project config in root

Releases

See GitHub Releases


License

See LICENSE


Need 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

turbovault4dbt-0.2.1.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

turbovault4dbt-0.2.1-py3-none-any.whl (49.8 kB view details)

Uploaded Python 3

File details

Details for the file turbovault4dbt-0.2.1.tar.gz.

File metadata

  • Download URL: turbovault4dbt-0.2.1.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for turbovault4dbt-0.2.1.tar.gz
Algorithm Hash digest
SHA256 aecc923ac83f76fe7057f20526d59c5114f42aa38466cbe482c1e8018fb805d4
MD5 8ca3033717535d7e611a38702f12e855
BLAKE2b-256 350f4bd4ad97b27f66a6337036c5c47ccce5a1026f809a40e6de974642232f94

See more details on using hashes here.

File details

Details for the file turbovault4dbt-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: turbovault4dbt-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 49.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for turbovault4dbt-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e90715ce927f4768455afdd047324118b24708a301f7fe99bb69fa84ffe85920
MD5 b9bc12d74a33541d2b2c35e6ccf216ce
BLAKE2b-256 d42873dc8a98d54c723835a9da6206600ea0ef486b0b3d35e731cff6860fc663

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page