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.0rc1.tar.gz (173.7 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.0rc1-cp311-abi3-win_amd64.whl (41.8 MB view details)

Uploaded CPython 3.11+Windows x86-64

wren_core_py-0.4.0rc1-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.4.0rc1-cp311-abi3-macosx_11_0_arm64.whl (42.5 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

wren_core_py-0.4.0rc1-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.4.0rc1.tar.gz.

File metadata

  • Download URL: wren_core_py-0.4.0rc1.tar.gz
  • Upload date:
  • Size: 173.7 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.0rc1.tar.gz
Algorithm Hash digest
SHA256 492931483827e96ec5c29d121eda3ed2e79854faf1ac0864ceef90281c9ec866
MD5 aac1ea51596f0c28f7e4b1dfd32b7970
BLAKE2b-256 119a664805c8efcf4979230e15aeba00688b24288d189ffbc28e175f91ea3bc1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.4.0rc1-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8aed0d53d41001d972309b21b0535823b4278c6c998dc6096c4d31133b3b6162
MD5 e5e0ecf69da5c80ce1f60c5ccfcd1c1a
BLAKE2b-256 a46ee2b7bfe05d97a9e143cc78942d475bbb4f3261cf4c6c105ed062914006c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.4.0rc1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7ba51205388ff976078d58b006f7f38cc47ebf1f999c925e40ffc17f7ce7bef1
MD5 3ba726d18a33718e4434a67740fca240
BLAKE2b-256 755baf22b4f785b2c7652ae15eefa52c22026f0812c437e293c4ee87998d474c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.4.0rc1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 43e294ed924f7976ce587d43f9a592cc5957e60c7421a82de0d59981378f9ffd
MD5 90fce88230903e916255a1fc8cd9c1a9
BLAKE2b-256 6f6b176bc3c6f7e007d217982fd5a8a1c3ca5a4361b93c24e28d30ee0cc8ca5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.4.0rc1-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 85b8009398577c2ab43d42265ccfa5054a38820c0e72e9cd5fb74b472a637a92
MD5 0f86b20a96d42cd22f03b3cc9c13a221
BLAKE2b-256 c535449a59ea1aed34d3c34b6b6e580110a7be0bb382fee2585c9f59ebc4537c

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