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.7.1.tar.gz (198.0 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.7.1-cp311-abi3-win_amd64.whl (42.3 MB view details)

Uploaded CPython 3.11+Windows x86-64

wren_core_py-0.7.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (48.4 MB view details)

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

wren_core_py-0.7.1-cp311-abi3-macosx_11_0_arm64.whl (43.1 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

wren_core_py-0.7.1-cp311-abi3-macosx_10_12_x86_64.whl (45.2 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: wren_core_py-0.7.1.tar.gz
  • Upload date:
  • Size: 198.0 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.7.1.tar.gz
Algorithm Hash digest
SHA256 321e9c727cc58f4824d77c9a91d2c63886fdc4b094bd7a2f9b70aba9a144bd4b
MD5 6059b82f857374aed77b897d00b49dc4
BLAKE2b-256 01a35975964d1b949c38fd2f2ed528cc3078e5d3322a5d5a6e06c219b378d28c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wren_core_py-0.7.1-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 42.3 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.7.1-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c6a5954d278b03d3557d6914263c84cab1cb18b0741b3db740bed279f3ccf67d
MD5 4479533c584c8917c3885b43878c4309
BLAKE2b-256 cf0279c5a8359a9097f3a4b4374053fa43bb61015215c4d2be74ec98baf47e34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.7.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b695fc2fb08c4437867ab83492cbe71d3be6726dfbe8528890524348d9a50b70
MD5 56043a84f861c629033954501f3aa673
BLAKE2b-256 28546671d2d4c5ec8d56dd321e5fff26f73eacb6a709008ac40b55a4d9aa01f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.7.1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4023f3f4d657a30ea9278f6528aac4b25c48e1327ad2a9b4b4554c0768c50fdc
MD5 daaded549ad09d088bb595b55f49e777
BLAKE2b-256 a36151e6b351fdcd9d07c586413434f74d9e316fafcfa257be41aa99a0181fad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.7.1-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 62a42ebb07028ee32ec320c96cf76afd8b4ee2ce75cd2da6475ced252e82b117
MD5 b9ee1d1ade8a237dba288785a7f07164
BLAKE2b-256 cf87c902c8896a1e4b3af0db4c8f9aa892a3dd63cc7dee92f189d9b99510ad35

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