Skip to main content

dbt-bq-sourcegen

License: MIT Python 3.11+

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 dbt-bq-sourcegen

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/

Metadata

Release files for dbt-bq-sourcegen 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbt-bq-sourcegen 0.1.2
File Size Uploaded Provenance Actions
dbt_bq_sourcegen-0.1.2.tar.gz 60.8 kB With provenance Details for dbt_bq_sourcegen-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dbt-bq-sourcegen 0.1.2
File Interpreter ABI Platform Actions
dbt_bq_sourcegen-0.1.2-py3-none-any.whl Python 3 none any Details for dbt_bq_sourcegen-0.1.2-py3-none-any.whl

Total release size: 75.4 kB

Release files / dbt_bq_sourcegen-0.1.2.tar.gz

Download URL dbt_bq_sourcegen-0.1.2.tar.gz
Size 60.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b297557e92afae1dbbd3973c60514a29ae37151727e6d241c8877ff111c41831
BLAKE2b-256 checksum
How to use checksums
60622131850ee625af5af17816cedfe850f15c73ada467add7f2fe24ce97ec37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.

Transparency log

Release files / dbt_bq_sourcegen-0.1.2-py3-none-any.whl

Download URL dbt_bq_sourcegen-0.1.2-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b208c8085f0bbfad2f19d72748e4934f56715764485530d20ef691c0fc647b0
BLAKE2b-256 checksum
How to use checksums
97bb7a5bd49952bdb6445e7eb94395e34d40997f9514ae983a85ecec6a3cff41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.

Transparency log

Security for dbt-bq-sourcegen 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dbt_bq_sourcegen-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page