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.3.0rc2.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.3.0rc2-cp311-abi3-win_amd64.whl (31.9 MB view details)

Uploaded CPython 3.11+Windows x86-64

wren_core_py-0.3.0rc2-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.3.0rc2-cp311-abi3-macosx_11_0_arm64.whl (31.9 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

wren_core_py-0.3.0rc2-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.3.0rc2.tar.gz.

File metadata

  • Download URL: wren_core_py-0.3.0rc2.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.3.0rc2.tar.gz
Algorithm Hash digest
SHA256 0bb72c4d715f6e315982f53ccd5e6813f255256922c1582176829de64aaf080c
MD5 69181b58662c7712cd6375eb9c3fb056
BLAKE2b-256 5d6a2df3283365200ad4e1c8dd0a19e20c90c9507ca6aabc234abafa20212b46

See more details on using hashes here.

File details

Details for the file wren_core_py-0.3.0rc2-cp311-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for wren_core_py-0.3.0rc2-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0260873f826f7ec5feb0242574be3438961bab57c7b2724e41f292be2cf5ee57
MD5 cd8ee02c26eefd67f4514afc203c5420
BLAKE2b-256 0f67e08127cc8f3a0f5483fe0fd072c3d19a334f14c7f9844911de39397a662c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.3.0rc2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aecb32d4a852d9a0ed1e10637c9c44a5de4ad069443a0f8654694fd987a37c7f
MD5 6c8b1962ee20e9523525e12e9df9a7cd
BLAKE2b-256 ad9122109fe9936c730f7ecb9386d2f3ed963af2dd589ecc33b64a69e22a6b4a

See more details on using hashes here.

File details

Details for the file wren_core_py-0.3.0rc2-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wren_core_py-0.3.0rc2-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 beff3a434e975f06f98b369b4acfdb98408b08283c1861ca15086c4690601e8d
MD5 53cc91c4aa22a06a29b4874fd34d82e1
BLAKE2b-256 380d03f905bd91979ce01544c3999d09e74986f2671a739137bff06904189114

See more details on using hashes here.

File details

Details for the file wren_core_py-0.3.0rc2-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for wren_core_py-0.3.0rc2-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 65dd1293efc82810fdd2158e2517788cd8d2833afb37159a8f4cbdfb86a5d9f7
MD5 170a4309212967716194eea7e6f7c87d
BLAKE2b-256 0464e705044c8bf86ae11b57f3e12d5ddb6d6ad0fc70209056023e350c036f66

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