Downloading a Package from dbt Hub

Learn how to download a package stored in the dbt Hub.

dbt Hub

Packages are dbt projects that contain reusable logic and can be imported into other projects. They foster software engineering best practices such as DRY code and version control.

dbt Hub is a repository of packages created by the dbt community. Downloading packages directly from dbt Hub has several benefits:

  • Packages must comply with a set of best practices to be accepted in the hub. Those best practices ensure a seamless user experience.

  • Hub packages are used and developed by a vast community, so it’s easy to find some support.

  • dbt Hub packages use semantic versioning. It’s a standardized scheme for software versioning where each version number consists of three parts: major, minor, and patch, indicating the degree of changes and backward compatibilities. Consequently, dependency conflicts between hub packages will be handled.

Popular hub packages

While dbt Hub contains hundreds of packages, here’s a short list of the most used packages and their functionalities:

  • dbt_utils provides a series of tests and macros that simplify complex dbt logic. This package is maintained by the dbt Labs team itself.

  • dbt_external_tables provides a dbtonic way to handle external sources, including tables based on Google Sheets or Google Cloud Storage. dbt Labs also maintains this package.

  • dbt_expectations contains a set of tests to assess and enforce the data quality of dbt models.

  • code-gen is a dbt Labs package that allows users to generate dbt code and log it to the command line.

packages.yml

In a dbt project, packages should be imported in a file called packages.yml:

Get hands-on with 1400+ tech skills courses.