OA Python SDK
oapython is the native Python distribution for the Rust OA runtime. It
installs the oa import package and mirrors Rust's public module structure:
python -m pip install oapython
import oa
engine = oa.Engine()
one = oa.matrix.ones(engine, [2, 3])
two = oa.matrix.full(engine, [2, 3], 2.0)
total = oa.matrix.add(one, two)
assert total.shape == [2, 3]
assert total.to_list() == [3.0] * 6
image = oa.Image.from_matrix(oa.matrix.ones(engine, [3, 2, 2]), "chw", "rgb")
flipped = oa.image.flip(image, horizontal=True, vertical=False)
Python mirrors Rust module ownership: root value aliases remain concise,
stateless operations live in oa.matrix, and the runtime owner is explicit.
Callers may use ordinary local abbreviations such as import oa.matrix as oam
or import oa.core as oac; OA does not publish duplicate alias modules. Host
observation through read_f32() or to_list() is the synchronization boundary.
The canonical PyO3 implementation lives in ../../src/py. Root
../../pyproject.toml and ../../uv.lock own packaging and environment
metadata; this SDK directory owns the importable package, PyO3 crate, and
tutorials.
Build from the repository root with:
python3 tool/build/workflow.py --profile debug --python-only
The workflow creates or reuses the root .venv, rebuilds the native extension,
then verifies package imports and native/distribution version agreement in a
fresh Python process. Re-run it after changing native exports; an older installed
extension does not gain renamed classes from edits to the Python wrappers.
Tests are located in the repository test/py/ directory and run with:
.venv/bin/python -m unittest discover -s test/py -v
Build the portable Python 3.10+ Linux wheel with:
.venv/bin/pip install ziglang
PATH="$PWD/.venv/bin:$PATH" ZIG_COMMAND=python-zig .venv/bin/maturin build --release --zig
The explicit Zig build prevents a developer workstation's newer glibc symbols from leaking into a wheel labeled for PyPI.
The Rust-first preview exposes runtime ownership and logging, explicit events, typed dense matrices, Matrix and ML functional operations, Image values/codecs/transforms, Audio values/codecs/DSP/capture/playback, cryptography, vision metrics, and the current Video surface.
Neural-network modules, optimizers, training sessions and programs, callbacks, reinforcement-learning trainers, flow matching, and SDK NLP recipes remain experimental. Python targets compute, ML, media, Plot, and Viewer preview; low-level Vulkan and UI construction remain Rust-only. Capability admission and hardware qualification are separate from binding availability.
Metadata
Release files for oapython 0.8.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oapython-0.8.6-cp310-abi3-manylinux_2_38_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.38+ x86-64 | Details |
Release files / oapython-0.8.6-cp310-abi3-manylinux_2_38_x86_64.whl
| Download URL | oapython-0.8.6-cp310-abi3-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 14.6 MB |
| Tags | CPython 3.10 Linux glibc 2.38+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3ede19893d3a8a5abc9605d8c704b1b32c9196c0ba063069d9e2ef2a975775ae
|
|
BLAKE2b-256 checksum How to use checksums |
50fa80f650e771601cd7b6276a3714b50a3f5278ae0a68564e9a798dad27d9ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 10, 2026.
Transparency log