CLI for Turbovault 4 DBT
Project description
TurboVault4dbt_cli
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
- Python 3.8+
- Metadata analysis done and stored in a supported format (see below)
- dbt project
- datavault4dbt dbt package
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:
- Source Data
- Standard Hubs
- Standard Links
- Non-Historized Links
- Standard Satellites
- Non-Historized Satellites
- Multi-Active Satellites
- Point-In-Time Tables
- Reference Tables
Installation (CLI Version)
- Clone this repository:
git clone https://github.com/ScalefreeCOM/turbovault4dbt.git cd turbovault4dbt
- (Recommended) Create and activate a virtual environment:
python3 -m venv turbovault-env source turbovault-env/bin/activate
- 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/withinput.xlsxandexpected_output/. - Negative test cases (expected failures) are also supported.
Project Structure
src/turbovault4dbt/— all source codetests/— regression test casespyproject.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aecc923ac83f76fe7057f20526d59c5114f42aa38466cbe482c1e8018fb805d4
|
|
| MD5 |
8ca3033717535d7e611a38702f12e855
|
|
| BLAKE2b-256 |
350f4bd4ad97b27f66a6337036c5c47ccce5a1026f809a40e6de974642232f94
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e90715ce927f4768455afdd047324118b24708a301f7fe99bb69fa84ffe85920
|
|
| MD5 |
b9bc12d74a33541d2b2c35e6ccf216ce
|
|
| BLAKE2b-256 |
d42873dc8a98d54c723835a9da6206600ea0ef486b0b3d35e731cff6860fc663
|