oxa — Python Reference Implementation
Pure, in-process protocol-conversion library for OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages in Python.
Like the Go and Rust implementations, oxa in Python is not a proxy, HTTP client, router, retry layer, authentication service, or model capability database. It provides deterministic, pure conversions between protocol wire structures and oxa's shared Intermediate Representation (IR).
Architecture
- Hub-and-spoke: Spoke packages (
oxa.openai.chatcompletions,oxa.openai.responses,oxa.anthropic.messages) implement onlyface → IRandIR → face. No direct face-to-face conversions. - Zero runtime dependencies: Pure Python standard library only
(
dataclasses,typing,json,enum, etc.). - Opaque tool inputs (INV-1): Tool call arguments and streaming delta fragments remain unparsed raw JSON text.
- Shared Golden Vectors: Conforms to the exact same shared
vectors/golden suite as Go and Rust.
Installation
pip install elkpi-oxa
Import in Python:
import oxa
from oxa.openai.chatcompletions import decode_request
Development
The project uses uv for development and
environment management:
cd python
# Sync virtualenv and development dependencies
uv sync
# Run tests
uv run pytest
# Type check
uv run mypy
# Lint & format check
uv run ruff check .
uv run ruff format --check .
Vectors Location Convention
Test harnesses locate the shared vectors/ suite by walking up parent
directories from python/ until finding a directory containing both vectors/
and .git/. Tests skip cleanly if the repository root is absent (e.g. when
building a standalone package archive).
Release files for elkpi-oxa 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| elkpi_oxa-1.0.0.tar.gz | 51.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| elkpi_oxa-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 114.3 kB
Release files / elkpi_oxa-1.0.0.tar.gz
| Download URL | elkpi_oxa-1.0.0.tar.gz |
|---|---|
| Size | 51.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68fee8651a8c0ba33409a59e6a1abe730d12463b27b4ce072fc790a9bfef8759
|
|
BLAKE2b-256 checksum How to use checksums |
fafe1a4c61a83943cf506dfccf85430225f2180253ed40cd35b360c02c8e35d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / elkpi_oxa-1.0.0-py3-none-any.whl
| Download URL | elkpi_oxa-1.0.0-py3-none-any.whl |
|---|---|
| Size | 62.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
07f822704531c77ae65698a04235748e948c11a16c9850c954fdb28d7a61aeff
|
|
BLAKE2b-256 checksum How to use checksums |
d872c173c37d1f5328904b9cbc027ccf7b5559825d0cd33a1bcd8518659aee25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|