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.1

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.1
File Size Uploaded Provenance Actions
yggdrasil_engine-3.0.1.tar.gz 29.0 kB Without provenance Details for yggdrasil_engine-3.0.1.tar.gz

Built distributions (wheels)

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

Total release size: 10.4 MB

Release files / yggdrasil_engine-3.0.1.tar.gz

Download URL yggdrasil_engine-3.0.1.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
51cbd9e768f9f0b4cf6c9aead0398ee03db6f885609823b87ec620c9c928213d
BLAKE2b-256 checksum
How to use checksums
11dc7954fe40057b8146707713d900092cc4e2ee3ffb673f12b171ad9e8483cd
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.1-cp310-abi3-win_arm64.whl

Download URL yggdrasil_engine-3.0.1-cp310-abi3-win_arm64.whl
Size 1.1 MB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
e5b2549aca1562ff91a80730e96ede3f3da16549f408012503064442417a8868
BLAKE2b-256 checksum
How to use checksums
b773b0bea9fa6029c8dbea306f85f511d88cf98a75ef0929c2c594550d5f5a50
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.1-cp310-abi3-win_amd64.whl

Download URL yggdrasil_engine-3.0.1-cp310-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ffa7bb5ee2a2f288449f8eacb392d9ff43197a02b077ccc5a502f943578d3b5c
BLAKE2b-256 checksum
How to use checksums
74ff649351873c995aa232f852e771e8cdc5e23641e43d1335b63431f2f36850
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.1-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL yggdrasil_engine-3.0.1-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
d60bfadb98967efa67e2e7eb53816276a472638ee494ff6fcde5b25991d05e32
BLAKE2b-256 checksum
How to use checksums
882291b34e9394c6af3a0f930778dec101e2a5822aed2ce33ee17c8a711d7d31
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.1-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL yggdrasil_engine-3.0.1-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
3cfcafa3c01fbf9dbfce7586d14ca5c11032dd00c01880768558c645fe7a1726
BLAKE2b-256 checksum
How to use checksums
c4f22bc794c8560dbceb7ce932b902a71fd77eeec3dad099218870a782dcf701
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.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL yggdrasil_engine-3.0.1-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
b1310c8cf43047f065f5c7024a961665662e01f2731876e61e397af79948aad5
BLAKE2b-256 checksum
How to use checksums
5ccba8ea9d87b71dcfc4a1b90ed6fed3e882cf31cc34652787f260c349566d5c
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.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL yggdrasil_engine-3.0.1-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
01f9852203d6fa704c8e49d2f95082f4fa1f862ee4e95a5bf1cdafd35ffe9455
BLAKE2b-256 checksum
How to use checksums
3e1d322cbec71d355808a23b6e2c623902256f28fb95e73ba095361d2f14c12d
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.1-cp310-abi3-macosx_11_0_x86_64.whl

Download URL yggdrasil_engine-3.0.1-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
ce1f3c09fd3c7efe030e482358b51dabd601d23321c94ce406cb22416fa05d31
BLAKE2b-256 checksum
How to use checksums
feeb7e56928eca72ba903b23d9ef0060cf77d64d6c34a33479a8f043d040ea97
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.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL yggdrasil_engine-3.0.1-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
17e0be59a00ea7e65d14f70095e5175bdacf290c08826fb69ed662572c8cc22e
BLAKE2b-256 checksum
How to use checksums
ee6a887a983667c7fe7f62f9c8319c31d9816ee3cd69c1a677ae13428e864aa8
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.1

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

This release

3.0.1 This release

9 release files No provenance

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