Skip to main content

dbt-4ps-generator

PyPI

CLI that generates dbt staging models from a bc2adls CDM export. For every entity in the manifest it writes:

  • stg_4ps__<table>.sql — a SELECT ... FROM STREAM READ_FILES(...) model with the column types from the CDM metadata and columns renamed to snake_case (CreditLimitLCY-20 → credit_limit_lcy)
  • _4ps__models.yaml — model + column descriptions, and a dbt_utils.unique_combination_of_columns test on each table's primary key

Full documentation: https://misja-pronk.github.io/dbt-4ps-staging/

Install

uvx dbt-4ps-generator --help          # run once, ephemerally
uv tool install dbt-4ps-generator     # install the command on PATH

Or from a checkout: uv run dbt-4ps-generator in this directory.

Usage

Download the CDM metadata from the Unity Catalog volume bc2adls exports to (authenticates via DATABRICKS_HOST/DATABRICKS_TOKEN or a ~/.databrickscfg profile):

dbt-4ps-generator download \
  --volume-path /Volumes/<catalog>/<schema>/<volume> \
  --output-directory ../_cdm

Generate the models:

dbt-4ps-generator generate \
  --manifest ../_cdm/deltas.manifest.cdm.json \
  --output-directory ../dbt_4ps_staging_package/models/staging/4ps

Options (see --help): --model-prefix (default stg_4ps__), --schema-prefix (default _4ps__), and --no-file-metadata-column to omit the _metadata source-file column.

Development

uv sync
uv run pytest
uv run ruff check . && uv run ruff format --check .
uv run ty check

Layout

File (src/dbt_4ps_generator/) Purpose
cli.py Typer CLI (generate, download)
cdm.py Pydantic models for the CDM manifest and entity files
converters.py CDM → dbt/SQL conversions (types, names, READ_FILES options)
dbt.py Builders that write the .sql models and schema yaml
sql.py SQL primitives (columns, options, streaming-table DDL builder)
databricks_helper.py Volume download via the Databricks SDK

Metadata

Release files for dbt-4ps-generator 0.1.1

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-4ps-generator 0.1.1
File Size Uploaded
dbt_4ps_generator-0.1.1.tar.gz 57.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dbt-4ps-generator 0.1.1
File Interpreter ABI Platform
dbt_4ps_generator-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 70.1 kB

Release files / dbt_4ps_generator-0.1.1.tar.gz

Download URL dbt_4ps_generator-0.1.1.tar.gz
Size 57.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4daf6a5d5afcc96befcd4816d015dea9c195dbb636ed4cf02819d882d5cf5f7a
BLAKE2b-256 checksum
How to use checksums
a1252615857e3a84d162d646e7973ad3bec50419edca2311fa455b1e422b59d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / dbt_4ps_generator-0.1.1-py3-none-any.whl

Download URL dbt_4ps_generator-0.1.1-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e31ea50eb076bf5f714fbe597409bb9a705b15eb401f69941bc8b32e51109eb
BLAKE2b-256 checksum
How to use checksums
8fc652f2c4ae1d791191ecd71c4296b5bcf3b8b3d6dd0ffd1fde632e4ce2c823
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

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