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.

Quick Start

from wren_core import SessionContext, to_manifest

# Load an MDL manifest from a base64-encoded JSON string
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.1.0.tar.gz (173.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wren_core_py-0.1.0-cp311-abi3-macosx_11_0_arm64.whl (31.0 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: wren_core_py-0.1.0.tar.gz
  • Upload date:
  • Size: 173.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for wren_core_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e1f85e4a76cd753850ab9750121c85788eff85ef9497481ac8c660bf92363e80
MD5 06b812da24fde2f21fd0c4893156c721
BLAKE2b-256 7e8964d5a0a5b4e6e4d9f36d0e8856e358b78f8df537d754457a143c596ade68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wren_core_py-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 51624141000c008cead7b330883d39fd36d2a1ffc10e18aedcf1a938df2ced6f
MD5 a2a5b9436fb22aee763b11e1ddece871
BLAKE2b-256 c83702dae70f121c22cfb60dd0a0e16afd349d193e4bdca0e836e0b1952bb3c1

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