Skip to main content

dbt-iPy

Run dbt commands inside a IPython session.

Installation

pip install dbt-ipy

Tutorial

You can access the tutorial notebook here

Quickstart Guide

Load the extension

%load_ext dbt-ipy

Connect to dbt RPC

The next thing you'll probably want to do is to run a dbt RPC server in the background. That will let you run queries, compile SQL code among other things:

%dbt rpc <args> (the args will be passed directly to dbt as command line arguments)

The two most important parameters would be:

  • --port [port_number] Passing this parameter will run the dbt RPC on that port. Default is 8580
  • --existing This will skip creating a new dbt RPC and instead it will connect to an existing one on the specified port

Custom magic commands

Compiling queries

The sql query in the cell will be compiled with the dbt RPC server and IPython will output the text::

%%compile_sql
SELECT ...

Running queries

The sql query in the cell will be run on the dbt RPC server and IPython will output the agate table. Also, it will run its .print_table() method::

%%run_sql
SELECT ...

Copying to clipboard

It is also possible to copy the last result returned by dbt to the clipboard. If that's a %%compile_sql compiled query it will return the SQL text but if it's a %%run_sql table, it will transform it to CSV and copy that to the clipboard. You can then paste the contents of the clipboard into a spreadsheet as usual.

%dbt_clipboard

Metadata

Release files for dbt-ipy 1.0.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-ipy 1.0.1
File Size Uploaded Provenance
dbt-ipy-1.0.1.tar.gz 17.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dbt-ipy 1.0.1
File Interpreter ABI Platform
dbt_ipy-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.5 kB

Release files / dbt-ipy-1.0.1.tar.gz

Download URL dbt-ipy-1.0.1.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
283d7c55291ceec8814654ebf4567deb59cec051042dca7c04b6762619fc257a
BLAKE2b-256 checksum
How to use checksums
4128534698fc50958f6ea3cfeb3e6a205c73da967b372c529beca2a3a5392b5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release files / dbt_ipy-1.0.1-py3-none-any.whl

Download URL dbt_ipy-1.0.1-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67e43b0e8e6f4c13b7eb15258b01aba298cc53d9a21c88b04d8560d4a4ff5f48
BLAKE2b-256 checksum
How to use checksums
35fabf67412f351b1281e97175cc616031fdc992d40a0f02e6c8e390dede8fe1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Security for dbt-ipy 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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