# 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 coming soon
## Features
- **Run Python scripts as dbt models** - Write Python logic directly in your dbt project
- **Fully typed Python models** - Complete type safety with IDE support ([see typing docs](docs/typing.md))
- **Multiple DataFrame libraries** - Support for both pandas and Polars dataframes (more comming soon)
- **Auto-generated documentation** - Python docstrings automatically become model descriptions in dbt docs
- **High performance** - Blazing fast execution using connectorx and asyncpg
- **PostgreSQL integration** - Seamless integration with PostgreSQL databases
## Installation
Install using [uv](https://docs.astral.sh/uv/) (recommended):
```bash
uv add dbt-debb
```
Or using pip:
```bash
pip install dbt-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
```yaml
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
```
2. Create Python models in your dbt project:
```python
# models/customer_analysis.py
"""Analyze customer purchase patterns using Polars."""
import polars as pl
from dbt.adapters.depp.typing import PolarsDbt, SessionObject
def model(dbt: PolarsDbt, session: SessionObject) -> pl.DataFrame:
# Reference existing models with full type safety
customers_df = dbt.ref("customers")
orders_df = dbt.ref("orders")
# Perform analysis using Polars
result = (
customers_df
.join(orders_df, on="customer_id", how="inner")
.group_by("customer_region")
.agg([
pl.col("order_amount").sum().alias("total_revenue"),
pl.col("customer_id").n_unique().alias("unique_customers"),
pl.col("order_amount").mean().alias("avg_order_value")
])
.sort("total_revenue", descending=True)
)
return result
```
3. `dbt run`!
## Development
This project uses [uv](https://docs.astral.sh/uv/) for dependency management:
```bash
# Install dependencies
uv sync
# Run tests
uv run pytest
# Build package
uv build
```
## Documentation
- **[Getting Started Guide](docs/getting-started.md)** - Complete setup guide including profiles.yml configuration and first Python models
- **[Type Safety Guide](docs/typing.md)** - Complete guide to using DEPP's type system for better IDE support and code safety
## 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.
Raw data
{
"_id": null,
"home_page": null,
"name": "dbt-depp",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "analytics, data-engineering, dbt, elt, etl, high-performance, pandas, polars, runtime",
"author": null,
"author_email": "Yassin Chibrani <y.chibrani@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/82/da/c33b330dc241d181fd860cc72a90dd8967c710d0b3cd5c9c4c42577e37f9/dbt_depp-0.1.7.tar.gz",
"platform": null,
"description": "# DEPP - DBT Python Postgres Adapter\nThis package support for running python models in dbt for postgres directly within your dbt project\nInspired on dbt-fal but made to be both extremely high performance and fully typed\nAlso supports polars dataframe besides pandas and more are coming soon\n\n## Features\n- **Run Python scripts as dbt models** - Write Python logic directly in your dbt project\n- **Fully typed Python models** - Complete type safety with IDE support ([see typing docs](docs/typing.md))\n- **Multiple DataFrame libraries** - Support for both pandas and Polars dataframes (more comming soon)\n- **Auto-generated documentation** - Python docstrings automatically become model descriptions in dbt docs\n- **High performance** - Blazing fast execution using connectorx and asyncpg\n- **PostgreSQL integration** - Seamless integration with PostgreSQL databases\n\n## Installation\n\nInstall using [uv](https://docs.astral.sh/uv/) (recommended):\n\n```bash\nuv add dbt-debb\n```\n\nOr using pip:\n\n```bash\npip install dbt-depp\n```\n\n## Quick Start\n\n1. Add to your `profiles.yml`:\nMake sure to both add a db_profile with all your details and add your database and schema\n\n```yaml\nyour_project:\n target: dev\n outputs:\n dev:\n type: depp\n db_profile: dev_postgres\n database: example_db\n schema: test\n \n dev_postgres:\n type: postgres\n host: localhost\n user: postgres\n password: postgres\n port: 5432\n database: example_db\n schema: test\n threads: 1\n```\n\n2. Create Python models in your dbt project:\n\n```python\n# models/customer_analysis.py\n\"\"\"Analyze customer purchase patterns using Polars.\"\"\"\nimport polars as pl\nfrom dbt.adapters.depp.typing import PolarsDbt, SessionObject\n\ndef model(dbt: PolarsDbt, session: SessionObject) -> pl.DataFrame:\n # Reference existing models with full type safety\n customers_df = dbt.ref(\"customers\")\n orders_df = dbt.ref(\"orders\")\n\n # Perform analysis using Polars\n result = (\n customers_df\n .join(orders_df, on=\"customer_id\", how=\"inner\")\n .group_by(\"customer_region\")\n .agg([\n pl.col(\"order_amount\").sum().alias(\"total_revenue\"),\n pl.col(\"customer_id\").n_unique().alias(\"unique_customers\"),\n pl.col(\"order_amount\").mean().alias(\"avg_order_value\")\n ])\n .sort(\"total_revenue\", descending=True)\n )\n\n return result\n```\n3. `dbt run`!\n\n## Development\nThis project uses [uv](https://docs.astral.sh/uv/) for dependency management:\n\n```bash\n# Install dependencies\nuv sync\n\n# Run tests\nuv run pytest\n\n# Build package\nuv build\n```\n\n## Documentation\n\n- **[Getting Started Guide](docs/getting-started.md)** - Complete setup guide including profiles.yml configuration and first Python models\n- **[Type Safety Guide](docs/typing.md)** - Complete guide to using DEPP's type system for better IDE support and code safety\n\n## Requirements\n\n- Python >= 3.12\n- dbt-core >= 1.10.0\n- PostgreSQL database\n\n## License\n\nThis project is open source and available under the MIT License.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.",
"bugtrack_url": null,
"license": "MIT",
"summary": "DBT Enexis Python Postgres adapter - Run python scripts from any dbt project.",
"version": "0.1.7",
"project_urls": {
"Homepage": "https://github.com/YassinCh/depp",
"Repository": "https://github.com/YassinCh/depp"
},
"split_keywords": [
"analytics",
" data-engineering",
" dbt",
" elt",
" etl",
" high-performance",
" pandas",
" polars",
" runtime"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9bf27f7d87d9a6f74598a7056e6a24323130acc75bf63a642924bb3fa473f758",
"md5": "1607ca0dd653e21d98f2d73628d8b88d",
"sha256": "21aa0414386448a2313cf73848337fda7552309fa9a766b57ec16653c26f3e77"
},
"downloads": -1,
"filename": "dbt_depp-0.1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1607ca0dd653e21d98f2d73628d8b88d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 27052,
"upload_time": "2025-10-22T10:47:18",
"upload_time_iso_8601": "2025-10-22T10:47:18.952974Z",
"url": "https://files.pythonhosted.org/packages/9b/f2/7f7d87d9a6f74598a7056e6a24323130acc75bf63a642924bb3fa473f758/dbt_depp-0.1.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "82dac33b330dc241d181fd860cc72a90dd8967c710d0b3cd5c9c4c42577e37f9",
"md5": "d84f9aece70051007fbcfd724305eabe",
"sha256": "628cec8d06070798c3bb35ea1e43af2d3570fd37c234a65300782af448891e86"
},
"downloads": -1,
"filename": "dbt_depp-0.1.7.tar.gz",
"has_sig": false,
"md5_digest": "d84f9aece70051007fbcfd724305eabe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 127639,
"upload_time": "2025-10-22T10:47:20",
"upload_time_iso_8601": "2025-10-22T10:47:20.314056Z",
"url": "https://files.pythonhosted.org/packages/82/da/c33b330dc241d181fd860cc72a90dd8967c710d0b3cd5c9c4c42577e37f9/dbt_depp-0.1.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-22 10:47:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "YassinCh",
"github_project": "depp",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "dbt-depp"
}