Skip to content
Query.Farm
Talk with Us

Vector Gateway Interface for Python

Extend DuckDB with functions written in Python — backed by Apache Arrow, callable straight from SQL.

Build statusPyPI versionSupported Python versionsLicense

Built for DuckDB

vgi-python implements the Vector Gateway Interface (VGI) for Python: you write a small worker exposing typed functions, and DuckDB calls them as if they were native. Data moves as Apache Arrow record batches, so it stays columnar and fast across the boundary — no row-by-row marshalling.

VGI workers expose five function shapes — pick the one whose input/output cardinality matches your problem. Each links to a complete, runnable example in the function patterns guide.

# with uv
uv add vgi-python

# or with pip
pip install vgi-python

Then follow the tutorial to build your first worker, or jump to the function patterns to find the shape that fits your problem.