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.5.0.tar.gz (173.6 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.5.0-cp311-abi3-win_amd64.whl (41.7 MB view details)

Uploaded CPython 3.11+Windows x86-64

wren_core_py-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (47.8 MB view details)

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

wren_core_py-0.5.0-cp311-abi3-macosx_11_0_arm64.whl (42.5 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

wren_core_py-0.5.0-cp311-abi3-macosx_10_12_x86_64.whl (44.5 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: wren_core_py-0.5.0.tar.gz
  • Upload date:
  • Size: 173.6 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.5.0.tar.gz
Algorithm Hash digest
SHA256 ffb78bf653a44f3258272bf67b5cc1576b48b411708033262976c13a0941f104
MD5 f05550fb451a66abf1c5cd8d43fcc4e0
BLAKE2b-256 5b6d82175d396d1f704f70a34707a18c2794213a5b40400c3a99446f81ab30c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wren_core_py-0.5.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 41.7 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.5.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4efcdda30228227dccc26cce4d47cdeb1b6ca634feb00a3d065b3a0f2f5e3873
MD5 3609f9a3a3c31032351417ee8b7b8c58
BLAKE2b-256 ab48daa7f8f30b7d255883b34bfb812281f70fcfea6e0ba6e35611e75c59e721

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ac9eb9fc15bff8a30c6ed627021e5f54f98721f36084099fa9fb40d1e4836368
MD5 6a7d0de8b76584e4a3784c367174eee2
BLAKE2b-256 23f5c6d47c5ea604b1604da4071ed22ae70dc8b0e925786a094cf5e71b70d590

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.5.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2f860ae3ea506f88078aad10d2e2078f36733cb3e727c5f254df9d7c5087e1cf
MD5 f6649c270b7eb00916fe80ef58f9afab
BLAKE2b-256 363893c6bfa594c902309c5c9ef07114fb0c8376711a06ba8129bfe5fb447f8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.5.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 353c98233837b94c535ef0ac9af0a18fe47fc617b53e1085f0fc946d61326f6b
MD5 b0494c828813fb339b8436f4d0cb9660
BLAKE2b-256 5effa111dc9a6471b7c2f8d69c5442a9b6c38a63463898b9978ee2ec9338d4ba

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