Skip to main content

Maintained by dataroots Python versions PiPy Downloads Code style: black Mypy checked

prefect-dbt-flow

prefect-dbt-flow is a Python library that enables Prefect to convert dbt workflows into independent tasks within a Prefect flow. This integration simplifies the orchestration and execution of dbt models and tests using Prefect, allowing you to build robust data pipelines and monitor your dbt projects efficiently.

dbt is an immensely popular tool for building and testing data transformation models, and Prefect is a versatile workflow management system. This integration brings together the best of both worlds, empowering data engineers and analysts to create robust data pipelines.

Key features:

  • Simplified Orchestration: Define and manage your dbt projects and models as Prefect tasks, creating a seamless pipeline for data transformation.
  • Monitoring and Error Handling: Gain deep insights into the execution of your dbt workflows and take immediate action in case of issues.
  • Workflow Consistency: Ensure your dbt workflows run consistently by managing them through Prefect. This consistency is crucial for maintaining data quality and reliability.
  • Advanced Configuration: Customize your dbt workflow by adjusting the dbt project, profile, and DAG options. You can also use Prefect features like scheduling, notifications, and task retries to monitor and manage your dbt flows effectively.

To get started, check out our getting started guide.

Active Development Notice: prefect-dbt-flow is actively under development and may not be ready for production use. We advise users to be aware of potential breaking changes as the library evolves. Please check the changelog for updates.

How to Install

You can install prefect-dbt-flow via pip:

pip install prefect-dbt-flow

Note: prefect-dbt-flow does not come with dbt as a dependency. You will need to install dbt or a dbt-adapter separately.

Basic Usage

Here's an example of how to use prefect-dbt-flow to create a Prefect flow for your dbt project:

from prefect_dbt_flow import dbt_flow
from prefect_dbt_flow.dbt import DbtProfile, DbtProject

my_flow = dbt_flow(
    project=DbtProject(
        name="jaffle_shop",
        project_dir="path_to/jaffle_shop",
        profiles_dir="path_to/jaffle_shop",
    ),
    profile=DbtProfile(
        target="dev",
        overrides={
            "type": "duckdb",
            "path": "path_to/duckdb.db",
        },
    ),
)

if __name__ == "__main__":
    my_flow()
jaffle_shop_dag

For more information consult the docs

Inspiration

prefect-dbt-flow draws inspiration from various projects in the data engineering and workflow orchestration space, including:

License

This project is licensed under the MIT License. You are free to use, modify, and distribute this software as per the terms of the license. If you find this project helpful, please consider giving it a star on GitHub.

Metadata

Release files for prefect-dbt-flow 0.5.8

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

Built distribution (wheel)

Table of built distributions (wheels) for prefect-dbt-flow 0.5.8
File Interpreter ABI Platform
prefect_dbt_flow-0.5.8-py3-none-any.whl Python 3 none any Details

Release files / prefect_dbt_flow-0.5.8-py3-none-any.whl

Download URL prefect_dbt_flow-0.5.8-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
016cf39cd53848164dc00af471e58220986a19dae4b8cc0fc1496d50217aea85
BLAKE2b-256 checksum
How to use checksums
ec98d0790cc3ddfb1eee505dcb08b492f91b7ef72c76ab056929d15ca178e4c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.8.18 Linux/6.5.0-1018-azure

Release history Release notifications | RSS feed

This release

0.5.8 This release

1 release file

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.3

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