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

Uploaded CPython 3.11+Windows x86-64

wren_core_py-0.6.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (47.9 MB view details)

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

wren_core_py-0.6.0-cp311-abi3-macosx_11_0_arm64.whl (42.6 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

wren_core_py-0.6.0-cp311-abi3-macosx_10_12_x86_64.whl (44.7 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: wren_core_py-0.6.0.tar.gz
  • Upload date:
  • Size: 183.1 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.6.0.tar.gz
Algorithm Hash digest
SHA256 cb0c947d5201b6857b95395edd3ccfd5e40ec0f2789f14781a3efc79b68644a0
MD5 a0147b72acf6d50d4a7637bfed0456b2
BLAKE2b-256 fb38b2cb577b44e0f167b1cd465f1f757d1e759f7d02b9156cc2d59da89f409c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wren_core_py-0.6.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 41.8 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.6.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b829a8faf28f44f58910bd73246e69a86bd01b14d45288cce52c712578ff8199
MD5 d9eb41aa8e158845cbba451778c0d1f8
BLAKE2b-256 599b3a8e1d8b38567f0112af7d0faf540ff61799980e68a6f8a423f42567b534

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.6.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eb3a453f7a86b8cd9325c2696585e3a6c042616e12fa3ed10b34e9a5793a9442
MD5 e866096104146a0fb896a3d560e8b7f5
BLAKE2b-256 111a2fae1e144252ab296df8fa5dcfb06b43c397028cb15a010b70709e76a04f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.6.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6d7b358778adc8a5bbaab3523f7021b060a4ba0b29527f0e917e8046574ef81e
MD5 af14cbfb974b7740f13a6d2dcc228b6b
BLAKE2b-256 a8cf3238a3ee4cabafb35d9731547a5600a3664801270af6a337f8768b1605fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.6.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 65bab57150c475edf55b7aac5dc3548196e5bd5eeff0e1aff8f0b8be164394b6
MD5 7b83f9fbc8d1d2f8c4719c8d977e7adc
BLAKE2b-256 e280ea296d00ace9d68c8619b6b2f2d506d231d1003f392fe49612b1a87edc65

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