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 Formats

  • Excel files: .xls, .xlsx
  • CSV files: folder of CSVs (one per sheet/table)

How does my metadata need to look like?

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


Installation

You can install TurboVault4dbt_cli directly from PyPI:

pip install turbovault4dbt

Or install from source for development:

git clone https://github.com/ScalefreeCOM/turbovault4dbt.git
cd turbovault4dbt
pip install -e .

Publishing to PyPI

  1. Build the package (inside your project directory):

    python -m build
    
  2. Upload to PyPI using Twine:

    pip install twine  # if not already installed
    twine upload dist/*
    
  3. (Optional) Test upload to TestPyPI first:

    twine upload --repository testpypi dist/*
    
  4. After upload, install your package from PyPI:

    pip install turbovault4dbt
    

For more details, see the official Python packaging docs.


Quickstart: Using the CLI

1. Prepare your metadata

  • Prepare your metadata as Excel (.xls or .xlsx) or as a folder of CSV files (one CSV per sheet/table, filenames matching required sheets).
  • (See metadata_ddl/ for example templates.)

2. Run TurboVault4dbt_cli

Basic usage:

# List all nodes in your metadata (Excel or CSV)
turbovault list -f xlsx path/to/your.xlsx
turbovault list -f csv path/to/your_csv_folder

# Generate dbt models for all nodes
turbovault run -f xlsx path/to/your.xlsx
turbovault run -f csv path/to/your_csv_folder

# Generate dbt models for selected nodes
turbovault run -f xlsx path/to/your.xlsx -s hub1 link1 sat1
turbovault run -f csv path/to/your_csv_folder -s '+hub1' '@sat1'

# Specify output directory
turbovault run -f xlsx path/to/your.xlsx --output-dir my_output_dir

Command reference:

  • turbovault run -f {xls|xlsx|csv} <input> [-s <selectors>] [--output-dir <dir>]
    Generate dbt models for all or selected nodes.
  • turbovault list -f {xls|xlsx|csv} <input> [-s <selectors>]
    List resolved nodes for a selector (dry run).

Arguments:

  • -f, --format: Input format. Must be one of: xls, xlsx, csv
  • input: Path to Excel file (.xls/.xlsx) or folder containing CSV files (for csv)
  • -s, --select: (Optional) Node selectors (space-separated).
    Examples: hub1, +sat1, hub2+, @masat3
  • --output-dir: (Optional) Output directory for generated files

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/
  • 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 PyPI 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.6.tar.gz (43.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.6-py3-none-any.whl (72.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: turbovault4dbt-0.2.6.tar.gz
  • Upload date:
  • Size: 43.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.6.tar.gz
Algorithm Hash digest
SHA256 ba1ca9a895edd9d4ec2cbfb7096da48309a070084246306d1e7c9c8b7513e7ef
MD5 991c835d66d6adbfa00971ffcfced4bd
BLAKE2b-256 1e25463dfa90e792973d4a02104dd4e1d441916b75a182eb62d907d5c155620e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: turbovault4dbt-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 72.7 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5395252fc7e6aad260d0e8a997152f3cec21ab2367db597c4e226ead35f50730
MD5 056dd9c09be2513773245d5f845fdf54
BLAKE2b-256 75c3db95e83f8097374bb332e1fa47134c9b863d9bc4f8a8e36109fa3b66f3b6

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