dbt-osmosis


Namedbt-osmosis JSON
Version 0.13.2 PyPI version JSON
download
home_pagehttps://github.com/z3z1ma/dbt-osmosis
SummaryA dbt server and suite of optional developer tools to make developing with dbt delightful.
upload_time2024-06-17 23:22:07
maintainerNone
docs_urlNone
authorz3z1ma
requires_python!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,>=3.9
licenseApache-2.0
keywords dbt server streamlit git diff
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # dbt-osmosis

<!--![GitHub Actions](https://github.com/z3z1ma/dbt-osmosis/actions/workflows/master.yml/badge.svg)-->

![PyPI](https://img.shields.io/pypi/v/dbt-osmosis)
[![Downloads](https://static.pepy.tech/badge/dbt-osmosis)](https://pepy.tech/project/dbt-osmosis)
![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-green.svg)
![black](https://img.shields.io/badge/code%20style-black-000000.svg)
[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://z3z1ma-dbt-osmosis-srcdbt-osmosisapp-v2-i0ico9.streamlit.app/)


[![Scc Count Badge](https://sloc.xyz/github/z3z1ma/dbt-osmosis/)](https://github.com/z3z1ma/dbt-osmosis/)
[![Scc Count Badge](https://sloc.xyz/github/z3z1ma/dbt-osmosis/?category=cocomo)](https://github.com/z3z1ma/dbt-osmosis/)

## New to dbt-osmosis?

We now have a spiffy [dbt-osmosis documentation site](https://z3z1ma.github.io/dbt-osmosis/)! 🎉

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

[![dbt-osmosis](/screenshots/docs_site.png)](https://z3z1ma.github.io/dbt-osmosis/)

## What is dbt-osmosis?

Hello and welcome to the project! [dbt-osmosis](https://github.com/z3z1ma/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

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

    > Automatically generate documentation based on upstream documented columns

2. A highly performant dbt server which integrates with tools such as dbt-power-user for VS Code to enable interactive querying + realtime compilation from your IDE

    2a. `dbt-osmosis server serve --project-dir ... --profiles-dir ...`

    > Spins up a WSGI server. Can be passed --register-project to automatically register your local project

3. 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]"`).

    3a. `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.

4. Diffs for data model outputs to model outputs across git revisions (🚧 this is in development)

    4a. `dbt-osmosis diff -m some_model  --project-dir ... --profiles-dir ...`

    > Run diffs on models dynamically. This pulls the state of the model before changes from your git history, injects it as a node to the dbt manifest, compiles the old and modified nodes, and diffs their query results optionally writing nodes to temp tables before running the diff query for warehouses with performance or query complexity limits (👀 bigquery)

____

## 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.

```yaml title=".pre-commit-config.yaml"
repos:
  - repo: https://github.com/z3z1ma/dbt-osmosis
    rev: v0.11.11 # verify the latest version
    hooks:
      - id: dbt-osmosis
        files: ^models/
        # you'd normally run this against your prod target, you can use any target though
        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](https://z3z1ma.github.io/dbt-osmosis/).

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](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://z3z1ma-dbt-osmosis-srcdbt-osmosisapp-v2-i0ico9.streamlit.app/)


```sh
# 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](/screenshots/osmosis_editor_main.png?raw=true "dbt-osmosis Workbench")

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

![pivot](/screenshots/osmosis_editor_pivot.png?raw=true "dbt-osmosis Pivot Layout")


**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](/screenshots/osmosis_tester.png?raw=true "dbt-osmosis 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](/screenshots/osmosis_profile.png?raw=true "dbt-osmosis Profile Data")


**Useful Links and RSS Feed**

Some useful links and RSS feeds at the bottom. 🤓

![profile-data](/screenshots/osmosis_links.png?raw=true "dbt-osmosis Profile Data")


___

![graph](https://repobeats.axiom.co/api/embed/df37714aa5780fc79871c60e6fc623f8f8e45c35.svg "Repobeats analytics image")


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/z3z1ma/dbt-osmosis",
    "name": "dbt-osmosis",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,>=3.9",
    "maintainer_email": null,
    "keywords": "dbt, server, streamlit, git, diff",
    "author": "z3z1ma",
    "author_email": "butler.alex2010@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e5/96/e88a35e91dd120d0f2afc5e2d610529f9c4592f7f24bed5dfa8d34df99a1/dbt_osmosis-0.13.2.tar.gz",
    "platform": null,
    "description": "# dbt-osmosis\n\n<!--![GitHub Actions](https://github.com/z3z1ma/dbt-osmosis/actions/workflows/master.yml/badge.svg)-->\n\n![PyPI](https://img.shields.io/pypi/v/dbt-osmosis)\n[![Downloads](https://static.pepy.tech/badge/dbt-osmosis)](https://pepy.tech/project/dbt-osmosis)\n![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-green.svg)\n![black](https://img.shields.io/badge/code%20style-black-000000.svg)\n[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://z3z1ma-dbt-osmosis-srcdbt-osmosisapp-v2-i0ico9.streamlit.app/)\n\n\n[![Scc Count Badge](https://sloc.xyz/github/z3z1ma/dbt-osmosis/)](https://github.com/z3z1ma/dbt-osmosis/)\n[![Scc Count Badge](https://sloc.xyz/github/z3z1ma/dbt-osmosis/?category=cocomo)](https://github.com/z3z1ma/dbt-osmosis/)\n\n## New to dbt-osmosis?\n\nWe now have a spiffy [dbt-osmosis documentation site](https://z3z1ma.github.io/dbt-osmosis/)! \ud83c\udf89\n\nPlease check it out for a more in-depth introduction to dbt-osmosis. \ud83d\udc47\n\n[![dbt-osmosis](/screenshots/docs_site.png)](https://z3z1ma.github.io/dbt-osmosis/)\n\n## What is dbt-osmosis?\n\nHello and welcome to the project! [dbt-osmosis](https://github.com/z3z1ma/dbt-osmosis) \ud83c\udf0a serves to enhance the developer experience significantly. We do this through providing 4 core features:\n\n1. Automated schema YAML management.\n\n    1a. `dbt-osmosis yaml refactor --project-dir ... --profiles-dir ...`\n\n    > 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)\n\n    1b. `dbt-osmosis yaml organize --project-dir ... --profiles-dir ...`\n\n    > Organize yaml files based on configurable rules defined in dbt_project.yml, scaffold new yaml files based on the same rules\n\n    1c. `dbt-osmosis yaml document --project-dir ... --profiles-dir ...`\n\n    > Automatically generate documentation based on upstream documented columns\n\n2. A highly performant dbt server which integrates with tools such as dbt-power-user for VS Code to enable interactive querying + realtime compilation from your IDE\n\n    2a. `dbt-osmosis server serve --project-dir ... --profiles-dir ...`\n\n    > Spins up a WSGI server. Can be passed --register-project to automatically register your local project\n\n3. 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]\"`).\n\n    3a. `dbt-osmosis workbench --project-dir ... --profiles-dir ...`\n\n    > 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.\n\n4. Diffs for data model outputs to model outputs across git revisions (\ud83d\udea7 this is in development)\n\n    4a. `dbt-osmosis diff -m some_model  --project-dir ... --profiles-dir ...`\n\n    > Run diffs on models dynamically. This pulls the state of the model before changes from your git history, injects it as a node to the dbt manifest, compiles the old and modified nodes, and diffs their query results optionally writing nodes to temp tables before running the diff query for warehouses with performance or query complexity limits (\ud83d\udc40 bigquery)\n\n____\n\n## Pre-commit\n\nYou 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.\n\n```yaml title=\".pre-commit-config.yaml\"\nrepos:\n  - repo: https://github.com/z3z1ma/dbt-osmosis\n    rev: v0.11.11 # verify the latest version\n    hooks:\n      - id: dbt-osmosis\n        files: ^models/\n        # you'd normally run this against your prod target, you can use any target though\n        args: [--target=prod]\n        additional_dependencies: [dbt-<adapter>]\n```\n\n___\n\n## Workbench\n\nThe 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](https://z3z1ma.github.io/dbt-osmosis/).\n\nI 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.\n\nDemo the workbench \ud83d\udc47\n\n[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://z3z1ma-dbt-osmosis-srcdbt-osmosisapp-v2-i0ico9.streamlit.app/)\n\n\n```sh\n# NOTE this requires the workbench extra as you can see\npip install \"dbt-osmosis[workbench]\"\n\n# Command to start server\ndbt-osmosis workbench\n```\n\nPress \"r\" to reload the workbench at any time.\n\n\n\u2714\ufe0f dbt Editor with instant dbt compilation side-by-side or pivoted\n\n\u2714\ufe0f Full control over model and workbench theme, light and dark mode\n\n\u2714\ufe0f Query Tester, test the model you are working on for instant feedback\n\n\u2714\ufe0f Data Profiler (leverages pandas-profiling)\n\n\n**Editor**\n\nThe 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.\n\n![editor](/screenshots/osmosis_editor_main.png?raw=true \"dbt-osmosis Workbench\")\n\nYou can pivot the editor for a fuller view while workbenching some dbt SQL.\n\n![pivot](/screenshots/osmosis_editor_pivot.png?raw=true \"dbt-osmosis Pivot Layout\")\n\n\n**Test Query**\n\nTest 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.\n\n![test-model](/screenshots/osmosis_tester.png?raw=true \"dbt-osmosis Test Model\")\n\n**Profile Model Results**\n\nProfile your datasets on the fly while you develop without switching context. Allows for more refined interactive data modelling when dataset fits in memory.\n\n![profile-data](/screenshots/osmosis_profile.png?raw=true \"dbt-osmosis Profile Data\")\n\n\n**Useful Links and RSS Feed**\n\nSome useful links and RSS feeds at the bottom. \ud83e\udd13\n\n![profile-data](/screenshots/osmosis_links.png?raw=true \"dbt-osmosis Profile Data\")\n\n\n___\n\n![graph](https://repobeats.axiom.co/api/embed/df37714aa5780fc79871c60e6fc623f8f8e45c35.svg \"Repobeats analytics image\")\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A dbt server and suite of optional developer tools to make developing with dbt delightful.",
    "version": "0.13.2",
    "project_urls": {
        "Documentation": "https://github.com/z3z1ma/dbt-osmosis",
        "Homepage": "https://github.com/z3z1ma/dbt-osmosis",
        "Repository": "https://github.com/z3z1ma/dbt-osmosis"
    },
    "split_keywords": [
        "dbt",
        " server",
        " streamlit",
        " git",
        " diff"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "42ed3be95c33334b19311b8af8d0dfa872b2e84c8e134cec10411980e7fe3c79",
                "md5": "cb831e692b40af533c437a69c2de8852",
                "sha256": "a8f506951de88d2b142f5763edda9d986f0419fb505f0a137fad80a0c961f20e"
            },
            "downloads": -1,
            "filename": "dbt_osmosis-0.13.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cb831e692b40af533c437a69c2de8852",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,>=3.9",
            "size": 117258,
            "upload_time": "2024-06-17T23:22:03",
            "upload_time_iso_8601": "2024-06-17T23:22:03.616499Z",
            "url": "https://files.pythonhosted.org/packages/42/ed/3be95c33334b19311b8af8d0dfa872b2e84c8e134cec10411980e7fe3c79/dbt_osmosis-0.13.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e596e88a35e91dd120d0f2afc5e2d610529f9c4592f7f24bed5dfa8d34df99a1",
                "md5": "0308e3193c54460f41a88d55ebd4ab5f",
                "sha256": "86a6c7a3fc119e747da76b9bcf9db9562d84498939c0e6522e5766ef02a28eb6"
            },
            "downloads": -1,
            "filename": "dbt_osmosis-0.13.2.tar.gz",
            "has_sig": false,
            "md5_digest": "0308e3193c54460f41a88d55ebd4ab5f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,>=3.9",
            "size": 110720,
            "upload_time": "2024-06-17T23:22:07",
            "upload_time_iso_8601": "2024-06-17T23:22:07.713512Z",
            "url": "https://files.pythonhosted.org/packages/e5/96/e88a35e91dd120d0f2afc5e2d610529f9c4592f7f24bed5dfa8d34df99a1/dbt_osmosis-0.13.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-17 23:22:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "z3z1ma",
    "github_project": "dbt-osmosis",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dbt-osmosis"
}
        
Elapsed time: 0.28965s