Skip to main content

Python bindings for Wren Engine semantic layer (wren-core)

Project description

Wren Core Python Binding

Python bindings for wren-core, the Rust semantic engine behind Wren Engine. Built with PyO3 and Maturin.

Wren Engine translates SQL queries through a semantic layer (MDL - Modeling Definition Language) and executes them against 22+ data sources (PostgreSQL, BigQuery, Snowflake, etc.).

Installation

pip install wren-core-py

Requires Python >= 3.11.

Pre-built wheels are available for:

  • Linux x86_64
  • macOS x86_64 / ARM64 (Apple Silicon)
  • Windows x86_64

Linux ARM64 wheels are not yet available. To use on that platform, build from source (requires Rust toolchain).

Quick Start

from wren_core import SessionContext, to_manifest

# Load an MDL manifest from a base64-encoded JSON string
base64_mdl_json = "<your-base64-encoded-mdl-json>"
manifest = to_manifest(base64_mdl_json)

# Create a session context for query planning
ctx = SessionContext(manifest, remote_functions=[])

# Transform a SQL query through the semantic layer
planned_sql = ctx.transform_sql("SELECT * FROM my_model")

Developer Guide

Environment Setup

Test and Build

After installing casey/just, you can use the following commands:

  • just install — Create Python venv and install dependencies.
  • just develop — Build the Rust package for local development (required before running Python tests).
  • just test-rs — Run Rust tests only.
  • just test-py — Run Python tests only.
  • just test — Run both Rust and Python tests.
  • just build — Build the Python wheel. Output goes to target/wheels/.

Coding Style

Format via just format.

Publishing

See scripts/publish.sh for local publishing to PyPI/TestPyPI:

./scripts/publish.sh --build    # Build wheel only
./scripts/publish.sh --test     # Build + publish to TestPyPI
./scripts/publish.sh            # Build + publish to PyPI

License

Apache-2.0

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

wren_core_py-0.4.0.tar.gz (171.4 kB view details)

Uploaded Source

Built Distributions

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

wren_core_py-0.4.0-cp311-abi3-win_amd64.whl (31.9 MB view details)

Uploaded CPython 3.11+Windows x86-64

wren_core_py-0.4.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.4 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

wren_core_py-0.4.0-cp311-abi3-macosx_11_0_arm64.whl (31.9 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

wren_core_py-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl (34.0 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file wren_core_py-0.4.0.tar.gz.

File metadata

  • Download URL: wren_core_py-0.4.0.tar.gz
  • Upload date:
  • Size: 171.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wren_core_py-0.4.0.tar.gz
Algorithm Hash digest
SHA256 eeeff691be31888fa23461bc61f2f0a1aa22075b4edeed8a44f6b8003d9397ff
MD5 b0f275ddc7957fb7a76b2f97f269dcc7
BLAKE2b-256 20e3409db4dc91d94c53a5b30e710a1dfd19a565e4941a19fdcc012585640281

See more details on using hashes here.

File details

Details for the file wren_core_py-0.4.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: wren_core_py-0.4.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 31.9 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wren_core_py-0.4.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d5e06c580e06b9d7743887ec805a935c7367d8adea9979068324f9c536e6835d
MD5 ac9b8a8efd9cb1f9377a9ed41d56b2fd
BLAKE2b-256 e479b15c0b5ee84ebe8a79b4eac7313a49d9b59bd04a35e26a68859297409469

See more details on using hashes here.

File details

Details for the file wren_core_py-0.4.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wren_core_py-0.4.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca5df17c2089aa01e0e05756906bae57c9060ea729e4116ad720cedbf96792dc
MD5 b17d33d04a116c34da53fb55cdf6939b
BLAKE2b-256 8ccbc193008309f5896c4f0723b852492e5f1b55506d4659d9ea15dce8eb9032

See more details on using hashes here.

File details

Details for the file wren_core_py-0.4.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wren_core_py-0.4.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e72656ab766a07f1bae87fa434d30a537514708557c06f27946803ad2a97cd67
MD5 c2bb1439db1b39100e0d57072e759cf7
BLAKE2b-256 064827119af3b960f05e7619e1145324e00fbf08691bd4f2156fbb0233854d8c

See more details on using hashes here.

File details

Details for the file wren_core_py-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for wren_core_py-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a12d841e2ff26f909119c3b7352b2a967d7d8b65d28949c13813b9a3fb3fee7f
MD5 2c8667761c137498e450f4f988913804
BLAKE2b-256 909421c6cb01a401c880c95e2c6e094f849490fe6ae19b0d2c6bb25b26f6d6a0

See more details on using hashes here.

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