Skip to main content

A dbt utility for managing YAML to make developing with dbt more delightful.

Project description

dbt-osmosis

PyPI Downloads License: Apache 2.0 black Streamlit App

Scc Count Badge Scc Count Badge

New to dbt-osmosis?

We now have a spiffy dbt-osmosis documentation site! 🎉

Please check it out for a more in-depth introduction to dbt-osmosis. 👇

dbt-osmosis

Migrating from 0.x.x to 1.x.x?

We have a migration guide to help you out. 🚀

What is dbt-osmosis?

Hello and welcome to the project! dbt-osmosis 🌊 serves to enhance the developer experience significantly. We do this through providing 4 core features:

  1. Automated schema YAML management.

    1a. dbt-osmosis yaml refactor --project-dir ... --profiles-dir ...

    Automatically generate documentation based on upstream documented columns, organize yaml files based on configurable rules defined in dbt_project.yml, scaffold new yaml files based on the same rules, inject columns from data warehouse schema if missing in yaml and remove columns no longer present in data warehouse (organize -> document)

    1b. dbt-osmosis yaml organize --project-dir ... --profiles-dir ...

    Organize yaml files based on configurable rules defined in dbt_project.yml, scaffold new yaml files based on the same rules (no documentation changes)

    1c. dbt-osmosis yaml document --project-dir ... --profiles-dir ...

    Automatically generate documentation based on upstream documented columns (no reorganization)

  2. Workbench for dbt Jinja SQL. This workbench is powered by streamlit and the badge at the top of the readme will take you to a demo on streamlit cloud with jaffle_shop loaded (requires extra pip install "dbt-osmosis[workbench]").

    2a. dbt-osmosis workbench --project-dir ... --profiles-dir ...

    Spins up a streamlit app. This workbench offers similar functionality to the osmosis server + power-user combo without a reliance on VS code. Realtime compilation, query execution, pandas profiling all via copying and pasting whatever you are working on into the workbenchat your leisure. Spin it up and down as needed.


Pre-commit

You can use dbt-osmosis as a pre-commit hook. This will run the dbt-osmosis yaml refactor command on your models directory before each commit. This is one way to ensure that your schema.yml files are always up to date. I would recommend reading the docs for more information on what this command does.

repos:
  - repo: https://github.com/z3z1ma/dbt-osmosis
    rev: v1.1.5 # verify the latest version
    hooks:
      - id: dbt-osmosis
        files: ^models/
        args: [--target=prod]
        additional_dependencies: [dbt-<adapter>]

Workbench

The workbench is a streamlit app that allows you to work on dbt models in a side-by-side editor and query tester. I've kept this portion of the README since users can jump into the streamlit hosted workbench to play around with it via the badge below. Expect the living documentation moving forward to exist at the dbt-osmosis documentation site.

I also expect there is some untapped value in the workbench that is only pending some time from myself. I've seen a path to a truly novel development experience and look forward to exploring it.

Demo the workbench 👇

Streamlit App

# NOTE this requires the workbench extra as you can see
pip install "dbt-osmosis[workbench]"

# Command to start server
dbt-osmosis workbench

Press "r" to reload the workbench at any time.

✔️ dbt Editor with instant dbt compilation side-by-side or pivoted

✔️ Full control over model and workbench theme, light and dark mode

✔️ Query Tester, test the model you are working on for instant feedback

✔️ Data Profiler (leverages pandas-profiling)

Editor

The editor is able to compile models with control+enter or dynamically as you type. Its speedy! You can choose any target defined in your profiles yml for compilation and execution.

editor

You can pivot the editor for a fuller view while workbenching some dbt SQL.

pivot

Test Query

Test dbt models as you work against whatever profile you have selected and inspect the results. This allows very fast iterative feedback loops not possible with VS Code alone.

test-model

Profile Model Results

Profile your datasets on the fly while you develop without switching context. Allows for more refined interactive data modelling when dataset fits in memory.

profile-data

Useful Links and RSS Feed

Some useful links and RSS feeds at the bottom. 🤓

profile-data


graph

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

dbt_osmosis-1.2.2.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbt_osmosis-1.2.2-py3-none-any.whl (155.6 kB view details)

Uploaded Python 3

File details

Details for the file dbt_osmosis-1.2.2.tar.gz.

File metadata

  • Download URL: dbt_osmosis-1.2.2.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for dbt_osmosis-1.2.2.tar.gz
Algorithm Hash digest
SHA256 93c4baab5493cb6ee500018091b92b54d38b1231131f38ce633b68cea55a22e2
MD5 32ef922b0f7ac10a903e8257248f00db
BLAKE2b-256 d3f12534fb5c6d067cbab07bd9947d257d2917d5bc4eb412ce40a4dffc505b6f

See more details on using hashes here.

File details

Details for the file dbt_osmosis-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: dbt_osmosis-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 155.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for dbt_osmosis-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4be6c1b8c07ad126d9224ad3e843aca5cf9757447c718eac72a682ae7e030989
MD5 93a83d9383c9270c5ba2cd398db162e0
BLAKE2b-256 5e6d3a63ffe1c451f079c460e5e4b5b51caad757613222fd9f782b21f07f40f3

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