Create or update dbt source YAML from BigQuery
Project description
dbt-bq-sourcegen
Create or update dbt source YAML from BigQuery.
Overview
dbt-bq-sourcegen automatically generates dbt source YAML files from BigQuery schemas, preserving existing configurations during updates.
It supports table filtering with wildcard patterns and maintains YAML formatting/comments.
This tool streamlines the process of keeping dbt source definitions in sync with your BigQuery datasets.
Installation
pip install git+https://github.com/K-Oxon/dbt-bq-sourcegen.git
Usage
Apply (create or update automatically)
dbt-bq-sourcegen apply \
--project-id your-project \
--schema your_dataset \
--output models/staging/your_dataset/src_your_dataset.yml
With table filtering
# Only include tables matching pattern
dbt-bq-sourcegen apply \
--project-id your-project \
--schema your_dataset \
--table-pattern "stg_*" \
--output models/staging/your_dataset/src_your_dataset.yml
# Exclude specific tables
dbt-bq-sourcegen apply \
--project-id your-project \
--schema your_dataset \
--exclude "temp" \
--output models/staging/your_dataset/src_your_dataset.yml
Options
--project-id: Google Cloud project ID (required)--schema,--dataset: BigQuery schema/dataset name (required)--output: Output YAML file path (required)--table-pattern: Table name pattern (e.g., 'stg_*')--exclude: Exclude tables containing this string
Features
- Automatically generates dbt source YAML from BigQuery schema
- Updates existing source YAML files while preserving custom configurations
- Supports table filtering with wildcard patterns
- Preserves YAML formatting and comments
- Pure Python implementation with clean separation of concerns
Development
# Install development dependencies
uv sync
# Run tests
uv run pytest
# Format code
uv run ruff format src/
Project details
Release history Release notifications | RSS feed
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 dbt_bq_sourcegen-0.1.1.tar.gz.
File metadata
- Download URL: dbt_bq_sourcegen-0.1.1.tar.gz
- Upload date:
- Size: 60.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a38c29fd6fe60f05f811d789e5c8b878f4be77c5b06b434125da3cb440b86653
|
|
| MD5 |
b62331d4b38948472c49d05a5c911a82
|
|
| BLAKE2b-256 |
7a5d2bb822f634eb70e16cfe1f0734a7ec6c6f1d99de8f5179a636da776b2266
|
Provenance
The following attestation bundles were made for dbt_bq_sourcegen-0.1.1.tar.gz:
Publisher:
release.yml on K-Oxon/dbt-bq-sourcegen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbt_bq_sourcegen-0.1.1.tar.gz -
Subject digest:
a38c29fd6fe60f05f811d789e5c8b878f4be77c5b06b434125da3cb440b86653 - Sigstore transparency entry: 271251982
- Sigstore integration time:
-
Permalink:
K-Oxon/dbt-bq-sourcegen@d684b764ff8e47bbc54390baceb641bb9d584006 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/K-Oxon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d684b764ff8e47bbc54390baceb641bb9d584006 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dbt_bq_sourcegen-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dbt_bq_sourcegen-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17cfd394565dd7457892e2307a354c10ea349d1421bb4750474f9733c7459354
|
|
| MD5 |
284290a66e39950b2a05721789564ba3
|
|
| BLAKE2b-256 |
eb237e798d800b20a448dab49625958d339a773dadafea408e875ea6d5e36995
|
Provenance
The following attestation bundles were made for dbt_bq_sourcegen-0.1.1-py3-none-any.whl:
Publisher:
release.yml on K-Oxon/dbt-bq-sourcegen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbt_bq_sourcegen-0.1.1-py3-none-any.whl -
Subject digest:
17cfd394565dd7457892e2307a354c10ea349d1421bb4750474f9733c7459354 - Sigstore transparency entry: 271251983
- Sigstore integration time:
-
Permalink:
K-Oxon/dbt-bq-sourcegen@d684b764ff8e47bbc54390baceb641bb9d584006 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/K-Oxon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d684b764ff8e47bbc54390baceb641bb9d584006 -
Trigger Event:
push
-
Statement type: