Skip to main content

Yggdrasil

pyyggdrasil packages the native dependency prefix used by the planning projects in this repository family.

The Python distribution name and import package are both pyyggdrasil; Python 3.11 or newer is required.

pyyggdrasil is the base of the planning-and-learning package chain. The shared workspace layout, the layered install order, and the common build-from-source and CMake-integration patterns are documented in the Planning and Learning build instructions; the sections below cover pyyggdrasil-specific details.

Each binary release has a matching complete corresponding-source archive on the GitHub releases page, containing Yggdrasil and its exact native dependency sources.

The formalism includes free relations (arbitrary-arity tuple sets keyed by their column types); the relational operations and queries over them live in tyr (tyr/datalog/lifted/database, see tyr's docs/database.md).

Python Integration

Install the wheel and query the native prefix:

import pyyggdrasil

print(pyyggdrasil.native_prefix())
print(pyyggdrasil.cmake_prefix())  # prefix to put on CMAKE_PREFIX_PATH
print(pyyggdrasil.cmake_dir())     # directory containing yggdrasilConfig.cmake
print(pyyggdrasil.include_dir())
print(pyyggdrasil.library_dirs())
print(pyyggdrasil.cmake_dirs())

The same paths are available from the shell:

python -m pyyggdrasil --prefix
python -m pyyggdrasil --cmake-dir
python -m pyyggdrasil --include-dir
python -m pyyggdrasil --version

Python packages that consume this native prefix should depend on:

dependencies = [
    "pyyggdrasil>=0.7.2,<0.8",
]

The bundled shared libraries make the coupling ABI-level, so pin to the same minor version. The exported CMake package version file uses SameMinorVersion compatibility accordingly.

Serialization Tables

pyyggdrasil.serialization.table provides the shared JSONValue, Row, and Table types and a pipe-separated table renderer:

from pyyggdrasil.serialization.table import Row, render_table

rows: list[Row] = [
    {"name": "first", "children": ["n1", "n2"]},
    {"name": "second", "children": []},
]
print(render_table(rows, prefix="n", aligned=False))  # Compact default.
print(render_table(rows, prefix="n", aligned=True))   # Pad columns for alignment.

The first column contains references n0 and n1 under the id header. Both modes use pipes without decorative separator rows. Dictionaries expand recursively into columns with grouped headers. Parent names appear above their first child; all leaf labels share the bottom header row. Empty dictionaries have no columns.

Flat lists of unambiguous scalars use brackets and commas, such as [n1,n2] or [n1] for a singleton. Empty lists render as []; nested or ambiguous lists use compact JSON. None renders as a blank cell; numbers and booleans use str. Pipes, backslashes, carriage returns, newlines, and tabs are escaped, so cells never span multiple lines. Empty input produces an empty string.

For a serialization dictionary, render its snapshots directly:

for name, table in dictionaries.tables().items():
    print(name)
    print(render_table(table["rows"], prefix=table["prefix"]))

Enums and variant kinds use their textual names directly. Native entities require registered tables, including entities encountered in nested fields. Missing registrations raise an error naming the type. Convert an entity to a string explicitly in a projection when its native text is wanted. The surrounding output order and text belong to the caller.

Build Python

Build a wheel from source:

uv build --wheel

The build recreates dependencies-build/ and dependencies-install/ from scratch. To package an existing native prefix without rebuilding dependencies:

YGGDRASIL_BUILD_NATIVE=OFF \
YGGDRASIL_NATIVE_PREFIX=/path/to/dependencies-install \
uv build --wheel

This bypass trusts the prefix as-is; use only one built from the dependency revisions in docs/SOURCES.json.

Native builds use all available processors by default. Set YGGDRASIL_JOBS to override the build parallelism. Set YGGDRASIL_BUILD_TYPE to select the dependency build profile; it defaults to Release.

Runtime libraries are stripped in the wheel by default. Disable that for debugging with:

YGGDRASIL_STRIP_WHEEL=OFF uv build --wheel

C++ contracts

Headers and templates follow the template and include rules, which also apply to the downstream libraries.

Use CanonicalizableContext<Context, Handle>; it replaces the former handle-first ordering and the CanonicalizableContextFor wrapper. extend and range set require iteration through a const range and append its elements through const references.

RowsView (rows_view(relation, ids, context)) reads row ids (index<Row<F>>) as the Row<F> views their context makes. It borrows the ids, which must outlive it and its views. Its accessors propagate exceptions from the underlying range and canonical-owner lookup.

Build C++

Native Dependencies

Build the native dependency prefix directly with CMake:

cmake -S src -B dependencies-build \
  -DCMAKE_INSTALL_PREFIX=dependencies-install \
  -DCMAKE_INSTALL_LIBDIR=lib

cmake --build dependencies-build --parallel
cmake --install dependencies-build

Yggdrasil builds its bundled dependencies as shared libraries. The native dependency prefix contains C++ headers, shared libraries, and CMake package configuration files consumed by the other projects.

Yggdrasil Targets

Configure Yggdrasil separately against the installed dependency prefix:

cmake -S . -B build \
  -DCMAKE_BUILD_TYPE=Debug \
  -DYGGDRASIL_NATIVE_PREFIX="$PWD/dependencies-install" \
  -DYGGDRASIL_BUILD_TESTS=ON

cmake --build build --parallel
ctest --test-dir build

CMake options:

Option Default Description
YGGDRASIL_BUILD_TESTS OFF Build Yggdrasil C++ tests.
YGGDRASIL_BUILD_PROFILING OFF Build Yggdrasil benchmark executables.
YGGDRASIL_ENABLE_FMT_FORMATTERS ON Enable Yggdrasil's public fmt formatters.
YGGDRASIL_USE_LLD ON Use LLVM lld with Clang when available.
YGGDRASIL_ENABLE_LTO ON Enable link-time optimization for Release builds.

Single-config CMake builds default to Release. On GCC and Clang, Debug builds use -Og with debug symbols, RelWithDebInfo keeps frame pointers and disables LTO, and Release LTO uses GCC LTO or Clang ThinLTO. Editable installs and wheels disable YGGDRASIL_USE_LLD and YGGDRASIL_ENABLE_LTO by default for build reliability. This compiler policy applies only to Yggdrasil's first-party extension and tests; the src/ dependency superbuild leaves each bundled project in control of its own compiler policy.

CMake Integration

The wheel ships a CMake package config (yggdrasilConfig.cmake) defining the yggdrasil::yggdrasil interface target. It carries the include directory, C++20 as a compile feature, and the bundled dependencies (Boost, fmt, gtl, TBB) via find_dependency. (cista is consumed through the include directory only — its target exports compile definitions that would otherwise change cista's hashing and fmt integration.) Downstream CMake projects consume it through CMAKE_PREFIX_PATH:

cmake -S . -B build \
  -DCMAKE_PREFIX_PATH="$(python -m pyyggdrasil --prefix)"
find_package(yggdrasil 0.4.0 CONFIG REQUIRED)
target_link_libraries(my_target PRIVATE yggdrasil::yggdrasil)

For compiler invocations launched from Python, use pyyggdrasil.include_dir() for the C++ headers and pyyggdrasil.library_dirs() for installed native library directories.

MPI

The wheel includes a TCP/shared-memory MPICH runtime and Boost.MPI. MPI remains opt-in and is not linked by yggdrasil::yggdrasil:

find_package(yggdrasil CONFIG REQUIRED)
set(MPI_HOME "${YGGDRASIL_NATIVE_PREFIX}")
set(MPI_CXX_SKIP_MPICXX ON)
find_package(MPI REQUIRED COMPONENTS CXX)
find_package(Boost CONFIG REQUIRED COMPONENTS mpi serialization
    PATHS "${YGGDRASIL_NATIVE_PREFIX}" NO_DEFAULT_PATH)
target_link_libraries(distributed PRIVATE
    MPI::MPI_CXX Boost::mpi Boost::serialization)

The launcher is ${YGGDRASIL_NATIVE_PREFIX}/bin/mpiexec, or from Python, pyyggdrasil.native_prefix() / "bin" / "mpiexec". Use the bundled launcher and libraries together; vendor interconnects and vendor MPI require a separate source build.

fmt Formatters

Yggdrasil's public fmt::formatter specializations are guarded by the YGG_ENABLE_FMT_FORMATTERS macro, which defaults to 1 (yggdrasil/core/config.hpp). Consumers can opt out by defining YGG_ENABLE_FMT_FORMATTERS=0. For Yggdrasil's own builds, the YGGDRASIL_ENABLE_FMT_FORMATTERS CMake option (default ON) toggles the macro.

Metadata

Release files for pyyggdrasil 0.7.2

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

Source distribution (sdist)

Source distribution for pyyggdrasil 0.7.2
File Size Uploaded Provenance Actions
pyyggdrasil-0.7.2.tar.gz 138.8 kB With provenance Details for pyyggdrasil-0.7.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pyyggdrasil 0.7.2
File Actions
pyyggdrasil-0.7.2-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for pyyggdrasil-0.7.2-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pyyggdrasil-0.7.2-cp311-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for pyyggdrasil-0.7.2-cp311-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
pyyggdrasil-0.7.2-cp311-abi3-macosx_11_0_x86_64.whl CPython 3.11 abi3 macOS 11.0+ x86-64 Details for pyyggdrasil-0.7.2-cp311-abi3-macosx_11_0_x86_64.whl
pyyggdrasil-0.7.2-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for pyyggdrasil-0.7.2-cp311-abi3-macosx_11_0_arm64.whl

Total release size: 942.3 kB

Release files / pyyggdrasil-0.7.2.tar.gz

Download URL pyyggdrasil-0.7.2.tar.gz
Size 138.8 kB
Tags Source
SHA-256 checksum
How to use checksums
131a01c21588cafa3bf25a280eb1781fa8c921ea39003245060e1065c8e63653
BLAKE2b-256 checksum
How to use checksums
1c11762d9cef423d1955bb9fe62cbb64c0bc781b1485e97f8ccf9d83ae79c71c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / pyyggdrasil-0.7.2-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pyyggdrasil-0.7.2-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 220.7 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
25b7ccd5e77afaedd56d94a1c901bfc4bfe87a9a72294b236cc4ced7caa6b05c
BLAKE2b-256 checksum
How to use checksums
835017d54b0c7b6ad0dbf51f88c0e19497c58b2090c5423bb8f8e1b2121fe400
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / pyyggdrasil-0.7.2-cp311-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL pyyggdrasil-0.7.2-cp311-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 211.9 kB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
d5213fa91e24b3543ff5173211325180e87eebb43b24663d491fe215cf03c5ed
BLAKE2b-256 checksum
How to use checksums
9ea29ed1cfb14618a9cb77f9c3ec12375905ce89657f24216efcd09a7bba91b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / pyyggdrasil-0.7.2-cp311-abi3-macosx_11_0_x86_64.whl

Download URL pyyggdrasil-0.7.2-cp311-abi3-macosx_11_0_x86_64.whl
Size 188.3 kB
Tags CPython 3.11 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
a29c0aa2bf71eaa1a727bc7d08ed142a3b800d27ce8a0f4fb190ab0adc5a9cfa
BLAKE2b-256 checksum
How to use checksums
8993a19f58de6da223712ef65129749ad4c5284ef12e40688126304c663ba0c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / pyyggdrasil-0.7.2-cp311-abi3-macosx_11_0_arm64.whl

Download URL pyyggdrasil-0.7.2-cp311-abi3-macosx_11_0_arm64.whl
Size 182.6 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e00d1b10db86f468a1464216c4d5fd78f1445c0e002f36e8c2b6ff6e6361f12c
BLAKE2b-256 checksum
How to use checksums
551b24d582d8a6a050c14672c8a1a9eb8aaf05a6cdbb90c750978c27a5c74d7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for pyyggdrasil 0.7.2

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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for pyyggdrasil-0.7.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

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

0.7.2 This release

5 release files Full 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