Skip to main content

DBT Enexis Python Postgres adapter - Run python scripts from any dbt project.

Project description

DEPP - DBT Python Postgres Adapter

This package support for running python models in dbt for postgres directly within your dbt project Inspired on dbt-fal but made to be both extremely high performance and fully typed Also supports polars dataframe besides pandas and more are comming soon

Features

  • Run Python scripts as dbt models
  • Python Docs string are automatically added as descriptin in docs (more doc improvement soon)
  • Python models are fully typed
  • Currently support for both pandas and polars dataframes (more comming soon)
  • Blazing performance using connectorx, asyncpg
  • Seamless integration with PostgreSQL databases (more comming soon)

Installation

Install using uv (recommended):

uv add depp

Or using pip:

pip install depp

Quick Start

  1. Add to your profiles.yml: Make sure to both add a db_profile with all your details and add your database and schema
your_project:
  target: dev
  outputs:
    dev:
      type: depp
      db_profile: dev_postgres
      database: example_db
      schema: test
      
    dev_postgres:
      type: postgres
      host: localhost
      user: postgres
      password: postgres
      port: 5432
      database: example_db
      schema: test
      threads: 1
  1. Create Python models in your dbt project:
# models/my_python_model.py
import polars as pl

def model(dbt, session):
    dbt.config(library="polars")
    # Your Python logic here
    df = pl.DataFrame({'column1': [1, 2, 3], 'column2': ['a', 'b', 'c']})
    return df
  1. dbt run!

Development

This project uses uv for dependency management:

# Install dependencies
uv sync

# Run tests
uv run pytest

# Build package
uv build

Requirements

  • Python >= 3.12
  • dbt-core >= 1.10.0
  • PostgreSQL database

License

This project is open source and available under the MIT License.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbt_depp-0.1.4.tar.gz (102.1 kB view details)

Uploaded Source

Built Distribution

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

dbt_depp-0.1.4-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file dbt_depp-0.1.4.tar.gz.

File metadata

  • Download URL: dbt_depp-0.1.4.tar.gz
  • Upload date:
  • Size: 102.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dbt_depp-0.1.4.tar.gz
Algorithm Hash digest
SHA256 deb3b3c1a03ca65327c78e99eb990937b07c9be3a4d66b963c227bb567bc2e16
MD5 076eb137abe0be4f40ff9faeb08b3f43
BLAKE2b-256 2d56b48d570c0037ea13d0ab54465d94857fc14d81bfc7f6aee982a54aedf60e

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbt_depp-0.1.4.tar.gz:

Publisher: publish.yml on YassinCh/depp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dbt_depp-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: dbt_depp-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dbt_depp-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c7021582e5b56103580958a935cd6bffa19e859572619183a6c537a87972f9bf
MD5 73f4f6007659f771fbe9beec6c9b95f6
BLAKE2b-256 a38600583bd59466d03b159a85c1d68578522a447d9ba8b78bc8bd0898efdded

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbt_depp-0.1.4-py3-none-any.whl:

Publisher: publish.yml on YassinCh/depp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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