Skip to main content

Python Bindings to Yggdrasil

Provides high level bindings to the Unleash Yggdrasil engine.

Implements the engine methods the Python SDK uses.

  • src/: the Rust part, compiled into the Python module yggdrasil_engine.yggdrasil_native
    • lib.rs: the Python glue around the core engine
  • python/yggdrasil_engine/: the Python package
  • tests/: python tests
  • scripts/smoke_test.py: checks an installed wheel; the publish workflow runs it on every platform

Test locally

Rust and Python 3.10 or newer is needed. Run everything from this folder (python-engine/).

The Python tests include the client specification, which they read from the repository root:

git clone --depth 1 --branch v6.1.0 https://github.com/Unleash/client-specification.git ../client-specification

Rust

cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings

Python

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install --group dev

Then build the engine, with one of the two commands below.

Both turn on the test-helpers cargo feature. It adds test-only functions to the module, which tests/test_context_reader.py needs. The published wheel is built without it.

While developing: maturin develop

maturin develop --features test-helpers
  • compiles the Rust code and puts the module into python/yggdrasil_engine/; the virtual environment uses this folder directly, so Python changes apply without rebuilding
  • after changing Rust code, run it again
  • debug build by default (faster to compile, slower to run); add --release for an optimised build

Like CI: install the package

MATURIN_PEP517_ARGS="--features test-helpers" python -m pip install .
  • builds the package the way the wheel is built (release mode) and installs it into the virtual environment, so the tests run against the installed package
  • after changing any code, Rust or Python, run it again

Then run the checks:

pytest
ruff format --check .
ruff check .

Context reader tests

tests/test_context_reader.py reads each context both with our reader and with unleash-types' parsing of json.dumps(context), and expects the same result. Needs the test-helpers` feature.

To run one case, give its full test ID (the case name goes in the brackets):

pytest -v "tests/test_context_reader.py::test_context_reader_matches_unleash_types[leftover string overrides properties]"

To run several cases, -k matches words in the case names, e.g. every case with "leftover":

pytest tests/test_context_reader.py -v -k leftover

When a case fails, -vv prints the full diff of the two contexts, and --showlocals (-l) also prints the test's local variables:

pytest tests/test_context_reader.py -vv -l -k leftover

Publish

  1. Bump version in pyproject.toml
  2. Run the manual Publish Python workflow (.github/workflows/publish-python.yml)

It builds one wheel per platform (Linux glibc and musl, macOS, Windows; x86_64 and arm64) and an sdist, installs each on a machine of its platform, runs scripts/smoke_test.py, and uploads to PyPI only if every test passed. With dry_run (the default) it builds and tests without uploading.

Metadata

Release files for yggdrasil-engine 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yggdrasil-engine 3.0.0
File Size Uploaded Provenance Actions
yggdrasil_engine-3.0.0.tar.gz 28.8 kB Without provenance Details for yggdrasil_engine-3.0.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for yggdrasil-engine 3.0.0
File Actions
yggdrasil_engine-3.0.0-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details for yggdrasil_engine-3.0.0-cp310-abi3-win_arm64.whl
yggdrasil_engine-3.0.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for yggdrasil_engine-3.0.0-cp310-abi3-win_amd64.whl
yggdrasil_engine-3.0.0-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for yggdrasil_engine-3.0.0-cp310-abi3-musllinux_1_2_x86_64.whl
yggdrasil_engine-3.0.0-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for yggdrasil_engine-3.0.0-cp310-abi3-musllinux_1_2_aarch64.whl
yggdrasil_engine-3.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for yggdrasil_engine-3.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
yggdrasil_engine-3.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for yggdrasil_engine-3.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
yggdrasil_engine-3.0.0-cp310-abi3-macosx_11_0_x86_64.whl CPython 3.10 abi3 macOS 11.0+ x86-64 Details for yggdrasil_engine-3.0.0-cp310-abi3-macosx_11_0_x86_64.whl
yggdrasil_engine-3.0.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for yggdrasil_engine-3.0.0-cp310-abi3-macosx_11_0_arm64.whl

Total release size: 10.4 MB

Release files / yggdrasil_engine-3.0.0.tar.gz

Download URL yggdrasil_engine-3.0.0.tar.gz
Size 28.8 kB
Tags Source
SHA-256 checksum
How to use checksums
35784c319de45e5ebbbb8d303324332cf2c23c9ce0668d76b0d31ff18c78b3c7
BLAKE2b-256 checksum
How to use checksums
12f16b931fa020b41f2b9ad2ffea4ba68a063921f946ca1c2c10fbfad8df8909
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / yggdrasil_engine-3.0.0-cp310-abi3-win_arm64.whl

Download URL yggdrasil_engine-3.0.0-cp310-abi3-win_arm64.whl
Size 1.1 MB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
c1f9392717bb78022baefde6041f0fd94b2b5a1cb45cccc2ece010e2fd04b4e1
BLAKE2b-256 checksum
How to use checksums
9bd045a72bdee9f31203966bb7251f25aa08d37078c81693dd7ac4fca7c07766
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / yggdrasil_engine-3.0.0-cp310-abi3-win_amd64.whl

Download URL yggdrasil_engine-3.0.0-cp310-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3e7e6d7932e56c26024a8453a79abb4335d467e97c997619c1e67fdffd20b9ca
BLAKE2b-256 checksum
How to use checksums
692a4e958759e7d87a04cb6a7426c7b24e8f258b1d7f325bf3a1d34d20ca67fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / yggdrasil_engine-3.0.0-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL yggdrasil_engine-3.0.0-cp310-abi3-musllinux_1_2_x86_64.whl
Size 1.5 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
738fcb1206846ec10fd55ef4188683d4f1f96c9e995addfa9ebf5afdbcd12e56
BLAKE2b-256 checksum
How to use checksums
31c0d3216f7fa342a901ceb72f7222fc7ef71f095614a45b1a63f21e9ce9aa9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / yggdrasil_engine-3.0.0-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL yggdrasil_engine-3.0.0-cp310-abi3-musllinux_1_2_aarch64.whl
Size 1.5 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
8bb6fc17db3f7e41ae68088fb755d60e49369b47bc55716c8a50802227e7ea60
BLAKE2b-256 checksum
How to use checksums
2cd6f66a46b24fceda7656e50ae6db81642b07cb9c09f9d9490170633615d3e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / yggdrasil_engine-3.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL yggdrasil_engine-3.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.3 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
a573ef5dbc0f2e6f616a9f61360fd617c3796c9b276c6a58a592feeaf7ad719b
BLAKE2b-256 checksum
How to use checksums
4cb8eea1bd166b90c91b5fb462ad7811001fbbb7f6e44d892b4fc37136827ba3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / yggdrasil_engine-3.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL yggdrasil_engine-3.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.3 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
25f8fa58cc0d2193b49d56cbbb8324926a00dfed6634eff80608c942e196d6c9
BLAKE2b-256 checksum
How to use checksums
5385f6c87ba71fe9b37971fd2e34950010c3fbaba6e5f60bd3a6de4f0687a3e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / yggdrasil_engine-3.0.0-cp310-abi3-macosx_11_0_x86_64.whl

Download URL yggdrasil_engine-3.0.0-cp310-abi3-macosx_11_0_x86_64.whl
Size 1.3 MB
Tags CPython 3.10 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
00940480c6b623b803819738cf180a1d3d0d27d71e78423f662edb2c9990a9f0
BLAKE2b-256 checksum
How to use checksums
c37ed8b9d32bf6f6b9e3771594feb05458f38f5e671d6e213acabf4b900bf941
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / yggdrasil_engine-3.0.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL yggdrasil_engine-3.0.0-cp310-abi3-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2c76cd6ddbe2091673805dc873ea4399167b9b218f14467f993fb8fa1e818deb
BLAKE2b-256 checksum
How to use checksums
181b315c7949ea90807a9a0b558b6e0f68e88452be0d92e4a6d0fbdc5a629800
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for yggdrasil-engine 3.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page